Skip to content

Commit 22fcf7f

Browse files
Merge pull request #30 from daanrijpkemacb/1.3.29
1.3.29
2 parents caac2ee + 1f64f16 commit 22fcf7f

File tree

3 files changed

+27
-11
lines changed

3 files changed

+27
-11
lines changed

bluem-idin.php

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,15 +1054,7 @@ function bluem_idin_shortcode_callback(): void
10541054
/**
10551055
* Determining the right callback.
10561056
*/
1057-
$goto = $bluem_config->IDINPageURL;
1058-
1059-
if (str_contains(sanitize_url(wp_unslash($_SERVER['REQUEST_URI'])), 'bluem-woocommerce/idin_shortcode_callback/go_to_cart')) {
1060-
$goto = wc_get_checkout_url();
1061-
} elseif (!empty($goto)) {
1062-
$goto = home_url($bluem_config->IDINPageURL);
1063-
} else {
1064-
$goto = home_url();
1065-
}
1057+
$goto = bluem_get_idin_shortcode_callback_url( $bluem_config );
10661058

10671059
switch ($statusCode) {
10681060
case 'Success': // in case of success...
@@ -1253,6 +1245,29 @@ function bluem_idin_shortcode_callback(): void
12531245
exit;
12541246
}
12551247

1248+
/**
1249+
* Determine the Callback URL for the iDIN shortcode flow
1250+
* @param Stdclass $bluem_config
1251+
*
1252+
* @return string
1253+
*/
1254+
function bluem_get_idin_shortcode_callback_url( Stdclass $bluem_config ): string {
1255+
1256+
if ( str_contains( sanitize_url( wp_unslash( $_SERVER['REQUEST_URI'] ) ), 'bluem-woocommerce/idin_shortcode_callback/go_to_cart' ) ) {
1257+
return wc_get_checkout_url();
1258+
} elseif ( ! empty( $bluem_config->IDINPageURL ) ) {
1259+
$callbackUrl = (string) $bluem_config->IDINPageURL;
1260+
1261+
// if goto is relative URL, append it with the home URL of WordPress
1262+
if ( ! str_starts_with( $callbackUrl, 'http://' ) && ! str_starts_with( $callbackUrl, 'https://' ) ) {
1263+
return home_url( $bluem_config->IDINPageURL );
1264+
}
1265+
// else just use goto
1266+
return $callbackUrl;
1267+
}
1268+
return home_url();
1269+
}
1270+
12561271
/**
12571272
* Identity webhook action
12581273
*

bluem.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
/**
44
* Plugin Name: Bluem ePayments, iDIN, eMandates services and integration for WooCommerce
5-
* Version: 1.3.28
5+
* Version: 1.3.29
66
* Plugin URI: https://bluem.nl/en/
77
* Description: Bluem integration for WordPress and WooCommerce for Payments, eMandates, iDIN identity verification and more
88
* Author: Bluem Payment Services

readme.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: Bluem,Payments,iDIN,iDEAL,eMandates
44
Requires at least: 5.0
55
Tested up to: 6.6
66
Requires PHP: 8.0
7-
Stable tag: 1.3.28
7+
Stable tag: 1.3.29
88
License: GPLv3
99
License URI: http://www.gnu.org/licenses/gpl-3.0.html
1010

@@ -77,6 +77,7 @@ Shortcode: `[bluem_identificatieformulier]`
7777
It is possible to programmatically block display and functionality on your site based on the verification status. Please contact us if you are interested in developing this in your site.
7878

7979
== Changelog ==
80+
- 1.3.29: Callback URL fix for iDIN shortcode
8081
- 1.3.28: Refactor SNS to ASN and update BIC list
8182
- 1.3.27: Certificate update (yearly refresh)
8283
- 1.3.26: Stability fixes and improvements for Contact Form integration

0 commit comments

Comments
 (0)