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