Skip to content

Commit 521b71b

Browse files
authored
Merge branch 'master' into feature/PLUG-5038
2 parents 086e31a + fdf1185 commit 521b71b

7 files changed

Lines changed: 41 additions & 13 deletions

File tree

assets/logos/19.png

-3.64 KB
Loading

includes/classes/PPMFWC/Gateway/Abstract.php

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,8 +694,8 @@ protected function startTransaction(WC_Order $order, $pickupLocation = null)
694694
$clean = preg_replace('/[^A-Za-z0-9]/u', '', $raw);
695695
$request->setReference($clean);
696696

697-
if ($this->getOptionId() == 1927) {
698-
$request->setTerminal(PPMFWC_Helper_Data::getPostTextField('terminal_id'));
697+
if ($this->getOptionId() == PayNL\Sdk\Model\Method::PIN) {
698+
$request->setTerminal($this->getTerminal());
699699
}
700700

701701
$extra1 = apply_filters('paynl-extra1', $order->get_order_number(), $order);
@@ -733,6 +733,30 @@ protected function startTransaction(WC_Order $order, $pickupLocation = null)
733733
return $payOrder;
734734
}
735735

736+
/**
737+
* @return false|string
738+
*/
739+
private function getTerminal()
740+
{
741+
$terminalThCode = PPMFWC_Helper_Data::getPostTextField('terminal_id');
742+
$terminal_setting = $this->get_option('paynl_instore_terminal');
743+
744+
if ($terminal_setting == 'checkout') {
745+
# do nothing, just use terminalThCode
746+
}
747+
if ($terminal_setting == 'checkout_save') {
748+
# Only save the tg-code in the cookie. This will then later be integrated in the checkout-view(hidden).
749+
setcookie('paynl_instore_terminal_id', $terminalThCode, time() + (60 * 60 * 24 * 365));
750+
751+
} elseif (str_starts_with(strtoupper($terminal_setting), 'TH')) {
752+
# A designated TH-code is selected as preferred terminal, so always use this one.
753+
$terminalThCode = $terminal_setting;
754+
}
755+
756+
757+
return $terminalThCode ?? '';
758+
}
759+
736760
/**
737761
* @return boolean
738762
*/

includes/classes/PPMFWC/Gateway/CapayableGespreid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public static function getId()
2121
*/
2222
public static function getName()
2323
{
24-
return 'iDEAL in3';
24+
return 'in3';
2525
}
2626

2727
/**

includes/classes/PPMFWC/Gateways.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -903,13 +903,15 @@ public static function ppmfwc_onReturn()
903903
public static function getOrderReturnUrl(WC_Order $order, $newStatus, $orderStatusId)
904904
{
905905
$payStatus = new PayStatus();
906+
$method = $order->get_payment_method() ?? '';
906907

907-
if ($payStatus->get($orderStatusId) === PayStatus::CANCEL)
908-
{
908+
if ($method == 'pay_gateway_instore' && (in_array($newStatus, [PPMFWC_Gateways::STATUS_CANCELED, PPMFWC_Gateways::STATUS_PENDING]))) {
909909
$url = add_query_arg('paynl_status', PPMFWC_Gateways::STATUS_CANCELED, wc_get_checkout_url());
910-
} elseif ($payStatus->get($orderStatusId) === PayStatus::DENIED ||
911-
$newStatus == PPMFWC_Gateways::STATUS_DENIED)
912-
{
910+
911+
} elseif ($payStatus->get($orderStatusId) === PayStatus::CANCEL) {
912+
$url = add_query_arg('paynl_status', PPMFWC_Gateways::STATUS_CANCELED, wc_get_checkout_url());
913+
914+
} elseif ($payStatus->get($orderStatusId) === PayStatus::DENIED || $newStatus == PPMFWC_Gateways::STATUS_DENIED) {
913915
$methodName = $order->get_payment_method_title();
914916
if (!empty($methodName)) {
915917
wc_add_notice(

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.2';
301+
return '4.0.3';
302302
}
303303

304304
/**

readme.txt

Lines changed: 5 additions & 3 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.2
8-
Tested up to: 6.8.3
9-
WC tested up to: 10.3.3
7+
Stable tag: 4.0.3
8+
Tested up to: 6.9.0
9+
WC tested up to: 10.3.5
1010
WC requires at least: 3.0
1111
Requires PHP: 8.1
1212
License: GPLv2
@@ -188,6 +188,8 @@ Paid accounts have better tariffs! see: [tariffs](https://pay.nl/tarieven)
188188
8. One platform for all payments.
189189

190190
== Changelog ==
191+
= 4.0.3 =
192+
Improved handling paid order data
191193
= 4.0.2 =
192194
Added option expire-time for transactions
193195
Fixed Klarna issue

woocommerce-payment-paynl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
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.2
7+
* Version: 4.0.3
88
* Author: Pay.
99
* Author URI: https://www.pay.nl
1010
* Requires at least: 6.1.0

0 commit comments

Comments
 (0)