関数
OrderEdit::updateOrderDataCompletion( stdClass $new_orderdata, string $old_status, stdClass $old_orderdata )
Updates ORO (Amazon Order Reference Object) based on selected order status.
説明 説明
=> 発送済み = calls capture
- $new_orderdata
(stdClass) (必須)
- $old_status
(文字列) (必須)
- $old_orderdata
(stdClass) (必須)
ファイル: src/V1/OrderEdit.php
public function updateOrderDataCompletion($new_orderdata, $old_status, $old_orderdata) { global $usces; $amazon_order_state = $usces->get_order_meta_value('amazon_order_state', $old_orderdata->ID); if (!empty($amazon_order_state)) { $amazon_authid = $usces->get_order_meta_value('amazon_authid', $old_orderdata->ID); $amazon_orderid = $usces->get_order_meta_value('amazon_orderid', $old_orderdata->ID); $res = []; if ($amazon_order_state === 'captured') { $res['message'] = __('I completed collective operation.', 'usces'); $res['method'] = 'capture'; $res['status'] = 'success'; } elseif ($amazon_order_state === 'canceled') { $res = Utils::adminErrorResponse('capture', $amazon_order_state); $res['message'] = Utils::adminMessageString( $old_orderdata->ID, $res['status'], $res['message'], true ); } else { $api = new API($this->module); $res = $api->capturePayments($amazon_authid, $amazon_orderid); $res['message'] = Utils::adminMessageString( $old_orderdata->ID, $res['status'], $res['message'], true ); } $_SESSION['amazon_admin_msg'] = $res; } }