クラス
SettlementInfo
ソース ソース
ファイル: src/Admin/API/SettlementInfo.php
class SettlementInfo
{
/**
* Returns Amazon Pay transaction info and history
*
* @author Evan D Shaw <evandanielshaw@gmail.com>
* @param mixed $args ['orderId']
* @return array
*/
public function get($args) {
$orderId = (int)$args['orderId'];
$order = new OrderMeta($orderId);
$settlementInfo = [
'state' => $order->getTransactionState()->getState(),
'stateReasonCode' => $order->getTransactionState()->getReasonCode(),
'stateReasonDescription' => $order->getTransactionState()->getReasonDescription(),
'stateDisplayText' => $order->getTransactionState()->getDisplayText(),
'stateCssClass' => $order->getTransactionState()->getCssClass(),
'chargeState' => $order->getChargeState(),
'refundState' => $order->getRefundState(),
'isUnmodifiable' => $order->getTransactionState()->isUnmodifiable(),
'amount' => $order->getMostRecentTransactionAmount(),
'log' => (new Models\Logger())->getSettlementHistoryLog($order->getChargePermissionId()),
];
http_response_code(200);
return $settlementInfo;
}
}
- get — Returns Amazon Pay transaction info and history