Skip to content

Commit e147409

Browse files
committed
Bumped versions
2 parents 6b9aa1d + 79a2f63 commit e147409

4 files changed

Lines changed: 31 additions & 8 deletions

File tree

includes/classes/PPMFWC/Gateways.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3+
use PayNL\Sdk\Model\Pay\PayOrder;
34
use PayNL\Sdk\Model\Pay\PayStatus;
45
use PayNL\Sdk\Util\Exchange;
56

@@ -1023,6 +1024,27 @@ public static function ppmfwc_getGateWayById($payment_profile_id)
10231024
return null;
10241025
}
10251026

1027+
/**
1028+
* @param string $action
1029+
* @param PayOrder $payOrder
1030+
* @param Exchange $exchange
1031+
* @return void
1032+
* @throws Exception
1033+
*/
1034+
private static function validateExchange(string $action, PayOrder $payOrder, Exchange $exchange): void
1035+
{
1036+
if ($payOrder->isPending() && $action != self::ACTION_PENDING) {
1037+
$exchange->setResponse(false, 'Unexpected action (' . $action . ') for order state pending.');
1038+
1039+
} elseif ($payOrder->isCancelled() && $action != self::ACTION_CANCEL) {
1040+
$exchange->setResponse(false, 'Unexpected action (' . $action . ') for order state cancelled.');
1041+
1042+
} elseif ($payOrder->isRefunded() && $action != self::ACTION_REFUND && $action != self::ACTION_REFUND_ADD) {
1043+
$exchange->setResponse(false, 'Unexpected action (' . $action . ') for order state refunded.');
1044+
1045+
}
1046+
}
1047+
10261048
/**
10271049
* Handles the Pay. Exchange requests
10281050
* @phpcs:ignore Squiz.Commenting.FunctionComment.MissingReturn
@@ -1042,9 +1064,7 @@ public static function ppmfwc_onExchange()
10421064
$payOrder = $exchange->process(PPMFWC_Helper_Config::getPayConfig());
10431065
$payOrderId = $payOrder->getOrderId();
10441066

1045-
if ($payOrder->isPending()) {
1046-
$exchange->setResponse(true, 'Ignoring pending.');
1047-
}
1067+
self::validateExchange($action, $payOrder, $exchange);
10481068

10491069
$order_id = $exchange->getReference();
10501070
$methodId = $payOrder->getPaymentMethod();

includes/classes/PPMFWC/Helper/Data.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ private static function parseDefaultLanguage($http_accept, $deflang = "en")
298298
*/
299299
public static function getVersion()
300300
{
301-
return '4.0.4';
301+
return '4.0.5';
302302
}
303303

304304
/**

readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ Donate link: https://www.pay.nl/webshops/plugin-woocommerce
44
Link: https://www.pay.nl
55
Tags: paynl, paymentmethods, iDEAL, betaalmethoden, pay
66
Requires at least: 6.1.0
7-
Stable tag: 4.0.4
7+
Stable tag: 4.0.5
88
Tested up to: 6.9.0
9-
WC tested up to: 10.4.2
9+
WC tested up to: 10.4.3
1010
WC requires at least: 3.0
1111
Requires PHP: 8.1
1212
License: GPLv2
@@ -188,6 +188,9 @@ Paid accounts have better tariffs! see: [tariffs](https://pay.nl/tarieven)
188188
8. One platform for all payments.
189189

190190
== Changelog ==
191+
= 4.0.5 =
192+
Fixed an icon issue
193+
UTH fixes
191194
= 4.0.4 =
192195
Fixed instore issues
193196
= 4.0.3 =

woocommerce-payment-paynl.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
* Plugin Name: Pay. Payment Methods for WooCommerce
55
* Plugin URI: https://wordpress.org/plugins/woocommerce-paynl-payment-methods/
66
* Description: Pay. Payment Methods for WooCommerce
7-
* Version: 4.0.4
7+
* Version: 4.0.5
88
* Author: Pay.
99
* Author URI: https://www.pay.nl
1010
* Requires at least: 6.1.0
1111
* WC requires at least: 6.5
12-
* WC tested up to: 10.4.2
12+
* WC tested up to: 10.4.3
1313
* Requires PHP: 8.1
1414
* Text Domain: woocommerce-paynl-payment-methods
1515
* Domain Path: /i18n/languages

0 commit comments

Comments
 (0)