関数
API::cancelOrder( int $orderid )
Cancels an ORO
パラメータ パラメータ
- $orderid
(数値) (必須)
ファイル: src/V1/API.php
public function cancelOrder($orderid) { $client = $this->module->getAmazonV1Client(); $return_obj = []; $return_obj['method'] = 'cancel'; $request_parameters = []; $request_parameters['amazon_order_reference_id'] = $orderid; $res = $client->cancelOrderReference($request_parameters); $res_json = json_decode($res->toJson()); if ($client->success) { $return_obj['status'] = 'success'; $return_obj['message'] = __('Amazon order cancellation successful.', 'wcexaap'); } elseif ($res_json->Error) { $return_obj['status'] = 'error'; $return_obj['code'] = $res_json->Error->Code; $return_obj['message'] = $res_json->Error->Message . __('Either this order has already been canceled, or payments have already been captured, thus completing the order.', 'wcexaap'); } return $return_obj; }