クラス
OrderList
Amazon Pay V1 order list batch operations
ソース ソース
ファイル: src/V1/OrderList.php
class OrderList { /** * AmazonPay module object * * @var AmazonPay */ protected $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; } /** * Batch updates for completion status. * * @deprecated 2.0.0 * @author Evan D Shaw <evandanielshaw@gmail.com> * @see function updateOrderData * @global \usc_e_shop $usces * @param string $msgstr * @param array $order_res * @param array $req $_REQUEST * @param integer $id * @param \WlcOrderList|\dataList $obj {@see use-e-shop/classes/orderList[2].class.php} * @return string */ public function batchUpdateOrderStatusCompletion($msgstr, $order_res, $req, $id, $obj) { global $usces; $amazon_order_state = $usces->get_order_meta_value('amazon_order_state', $id); if (!empty($amazon_order_state)) { $api = new API($this->module); $amazon_orderid = $usces->get_order_meta_value('amazon_orderid', $id); $amazon_authid = $usces->get_order_meta_value('amazon_authid', $id); if (strtolower($amazon_order_state) === 'captured') { $res['status'] = 'success'; $res['message'] = __('I completed collective operation.', 'usces'); } elseif (strtolower($amazon_order_state) === 'canceled') { $res = Utils::adminErrorResponse('capture', $amazon_order_state); } else { $res = $api->capturePayments($amazon_authid, $amazon_orderid); } $res['message'] .= '<br/><br/>'; $msgstr .= Utils::adminMessageString($id, $res['status'], $res['message'], false); if (strtolower($res['status']) !== 'error') { ModuleUtils::updateOrderReceipt($id, 'receipted'); usces_action_acting_getpoint($id); $usces->set_order_meta_value('amazon_order_state', 'captured', $id); } } return $msgstr; } /** * Batch updates for cancel status. * * @deprecated 2.0.0 * @author Evan D Shaw <evandanielshaw@gmail.com> * @see function updateOrderData * @global \usc_e_shop $usces * @param string $msgstr * @param array $order_res * @param array $req $_REQUEST * @param integer $id * @param WlcOrderList|dataList $obj {@see use-e-shop/classes/orderList[2].class.php} * @return string */ public function batchUpdateOrderStatusCancel($msgstr, $order_res, $req, $id, $obj) { global $usces; $amazon_order_state = $usces->get_order_meta_value('amazon_order_state', $id); if (!empty($amazon_order_state)) { $api = new API($this->module); $amazon_orderid = $usces->get_order_meta_value('amazon_orderid', $id); if (strtolower($amazon_order_state) === 'canceled') { $res['status'] = 'success'; $res['message'] = __('I completed collective operation.', 'usces'); } elseif (strtolower($amazon_order_state) === 'captured') { $res = Utils::adminErrorResponse('cancel', $amazon_order_state); } else { $res = $api->cancelOrder($amazon_orderid); } $res['message'] .= '<br/><br/>'; $msgstr .= Utils::adminMessageString($id, $res['status'], $res['message'], false); if (strtolower($res['status']) !== 'error') { ModuleUtils::updateOrderReceipt($id, 'noreceipt'); $usces->set_order_meta_value('amazon_order_state', 'canceled', $id); } } return $msgstr; } }
- __construct — Sets $module member var with dependency injection.
- batchUpdateOrderStatusCancel — Batch updates for cancel status. — 非推奨
- batchUpdateOrderStatusCompletion — Batch updates for completion status. — 非推奨