関数
OrderEdit::updateOrderDataCancel( stdClass $new_orderdata, string $old_status, stdClass $old_orderdata )
Updates ORO (Amazon Order Reference Object) based on selected order status.
説明 説明
=> キャンセル = calls cancel
- $new_orderdata
(stdClass) (必須)
- $old_status
(文字列) (必須)
- $old_orderdata
(stdClass) (必須)
ファイル: src/V1/OrderEdit.php
public function updateOrderDataCancel($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_orderid = $usces->get_order_meta_value('amazon_orderid', $old_orderdata->ID); $res = []; if ($amazon_order_state === 'canceled') { $res['message'] = __('I completed collective operation.', 'usces'); $res['method'] = 'cancel'; $res['status'] = 'success'; } elseif ($amazon_order_state === 'captured') { $res = Utils::adminErrorResponse('cancel', $amazon_order_state); $res['message'] = Utils::adminMessageString( $old_orderdata->ID, $res['status'], $res['message'], true ); } else { $api = new API($this->module); $res = $api->cancelOrder($amazon_orderid); $res['message'] = Utils::adminMessageString( $old_orderdata->ID, $res['status'], $res['message'], true ); } $_SESSION['amazon_admin_msg'] = $res; } }