File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1041,8 +1041,14 @@ public static function ppmfwc_onExchange()
10411041 $ payOrder = $ exchange ->process (PPMFWC_Helper_Config::getPayConfig ());
10421042 $ payOrderId = $ payOrder ->getOrderId ();
10431043
1044- if ($ payOrder ->isPending ()) {
1044+ if ($ payOrder ->isPending () && $ action == self :: ACTION_PENDING ) {
10451045 $ exchange ->setResponse (true , 'Ignoring pending. ' );
1046+ } elseif ($ payOrder ->isPending () && $ action != self ::ACTION_PENDING ) {
1047+ $ exchange ->setResponse (false , 'Unexpected action ( ' . $ action . ') for order state Pending. ' );
1048+ } elseif ($ payOrder ->isCancelled () && $ action != self ::ACTION_CANCEL ) {
1049+ $ exchange ->setResponse (false , 'Unexpected action ( ' . $ action . ') for order state Cancelled. ' );
1050+ } elseif ($ payOrder ->isRefunded () && $ action != self ::ACTION_REFUND && $ action != self ::ACTION_REFUND_ADD ) {
1051+ $ exchange ->setResponse (false , 'Unexpected action ( ' . $ action . ') for order state Cancelled. ' );
10461052 }
10471053
10481054 $ order_id = $ exchange ->getReference ();
You can’t perform that action at this time.
0 commit comments