クラス
Cancel
Amazon Pay cancel API
ソース ソース
ファイル: src/Admin/API/Cancel.php
class Cancel { /** * AmazonPay module object * * @var AmazonPay */ private $module; /** * Sets `$module` member var with dependency injection. * * @author Evan D Shaw <evandanielshaw@gmail.com> * @param AmazonPay $module * @return void */ public function __construct(AmazonPay $module) { $this->module = $module; } /** * Cancels an order and returns Amazon Pay transaction info and history * * @author Evan D Shaw <evandanielshaw@gmail.com> * @param array $args ['orderId'] * @param array $payload * @return array */ public function delete($args, $payload) { $orderId = (int)$args['orderId']; $reason = $payload['reason']; $order = new OrderMeta($orderId); (new API\Charge\Cancel($this->module, $order))->delete($order->getChargeId(), $reason); return (new SettlementInfo())->get($args); } }
- __construct — Sets $module member var with dependency injection.
- delete — Cancels an order and returns Amazon Pay transaction info and history