Skip to content

Commit 0923984

Browse files
PLUG-5162 - paylink fix
1 parent 583b907 commit 0923984

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

includes/classes/PPMFWC/Gateways.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff 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();

0 commit comments

Comments
 (0)