クラス
Capture
Amazon Pay capture API
ソース ソース
ファイル: src/Admin/API/Capture.php
class Capture { /** * 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; } /** * Captures an order and returns Amazon Pay transaction info and history * * @author Evan D Shaw <evandanielshaw@gmail.com> * @param mixed $args ['orderId', 'captureAmount'] * @return array */ public function post($args) { $orderId = (int)$args['orderId']; $amount = $args['captureAmount']; $order = new OrderMeta($orderId); (new API\Charge\Capture($this->module, $order))->post( $order->getChargeId(), $amount, $order->getPaymentCurrency() ); return (new SettlementInfo())->get($args); } }
- __construct — Sets $module member var with dependency injection.
- post — Captures an order and returns Amazon Pay transaction info and history