@@ -32,6 +32,7 @@ class PPMFWC_Gateways
3232 const ACTION_VERIFY = 'verify ' ;
3333 const ACTION_REFUND = 'refund:received ' ;
3434 const ACTION_REFUND_ADD = 'refund:add ' ;
35+ const ACTION_REFUND_SEND = 'refund:send ' ;
3536 const ACTION_CAPTURE = 'capture ' ;
3637 const ACTION_CHARGEBACK = 'chargeback:chargeback ' ;
3738 const ACTION_PINREFUND = 'pinrefund ' ;
@@ -1036,14 +1037,13 @@ public static function ppmfwc_getGateWayById($payment_profile_id)
10361037 private static function validateExchange (string $ action , PayOrder $ payOrder , Exchange $ exchange ): void
10371038 {
10381039 if ($ payOrder ->isPending () && $ action != self ::ACTION_PENDING ) {
1039- $ exchange ->setResponse (false , ' Unexpected action ( ' . $ action . ' ) for order state pending. ' );
1040+ $ exchange ->setResponse (false , " Unexpected action ( { $ action} ) for order state pending. " );
10401041
10411042 } elseif ($ payOrder ->isCancelled () && $ action != self ::ACTION_CANCEL ) {
1042- $ exchange ->setResponse (false , 'Unexpected action ( ' . $ action . ') for order state cancelled. ' );
1043-
1044- } elseif ($ payOrder ->isRefunded () && $ action != self ::ACTION_REFUND && $ action != self ::ACTION_REFUND_ADD ) {
1045- $ exchange ->setResponse (false , 'Unexpected action ( ' . $ action . ') for order state refunded. ' );
1043+ $ exchange ->setResponse (false , "Unexpected action ( {$ action }) for order state cancelled. " );
10461044
1045+ } elseif ($ payOrder ->isRefunded () && stripos ($ action , 'refund ' ) === false ) {
1046+ $ exchange ->setResponse (false , "Unexpected action ( {$ action }) for order state refunded. " );
10471047 }
10481048 }
10491049
0 commit comments