関数
OrderEdit::updateOrderDataCancel( stdClass $new_orderdata, string $old_status, stdClass $old_orderdata )
パラメータ パラメータ
- $new_orderdata
(stdClass) (必須)
- $old_status
(文字列) (必須)
- $old_orderdata
(stdClass) (必須)
ファイル: src/Admin/OrderEdit.php
225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 | protected function updateOrderDataCancel( $new_orderdata , $old_status , $old_orderdata ) { ( new V1OrderEdit( $this ->module))->updateOrderDataCancel( $new_orderdata , $old_status , $old_orderdata ); $opts = $this ->module->getActingOpts(); if ( $opts [ 'sync_with_order_status_changes' ] !== 'on' ) { return ; } $orderId = (int) $old_orderdata ->ID; try { $order = new OrderMeta( $orderId ); } catch (InvalidArgumentException $e ) { // not an Amazon Pay V2 order... return ; } if ( $order ->getRefundState() !== null) { return ; } $cstate = $order ->getChargeState()->getState(); if ( $cstate !== Charge\State::AUTHORIZED && $cstate !== Charge\State::DECLINED) { return ; } $result = ( new API\Charge\Cancel( $this ->module, $order ))-> delete ( $order ->getChargeId(), '' ); if ( $result instanceof GenericError) { $this ->orderUpdateErrorMessage = $result ->message; } } |