Skip to content

Commit ec017f1

Browse files
Merge pull request #382 from Billmate/dev
Prepearing for realase 3.9.3
2 parents 615e8a7 + 060bc82 commit ec017f1

3 files changed

Lines changed: 22 additions & 10 deletions

File tree

‎src/Readme.txt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ If you would like to use our logos on your site:
8484
https://www.billmate.se/press-och-media/
8585
== Changelog ==
8686

87+
= 3.9.3 (2020-01-28)
88+
* Fix - Card payment comes to the right thank you page with Polylang
89+
8790
= 3.9.2 (2020-01-23)
8891
* Fix - Resolved debug errors being generated by module
8992
* Fix - Resolved critical error in library, caused by Wordpress not being able to connect to Billmates API

‎src/commonfunctions.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
2-
define('BILLPLUGIN_VERSION','3.9.2');
2+
define('BILLPLUGIN_VERSION','3.9.3');
33
define('BILLMATE_CLIENT','PHP:Woocommerce:'.BILLPLUGIN_VERSION);
44
define('BILLMATE_SERVER','2.1.9');
55

‎src/gateway-billmate.php‎

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,7 @@ public function common_check_ipn_response($config = array()) {
477477
$checkout = false;
478478
$k = new Billmate($this->eid,$this->secret,true,$testmode == 'yes',false);
479479
$payment_note = '';
480+
$redirect = '';
480481

481482
if(!empty($_GET['method']) && $_GET['method'] == 'checkout')
482483
$checkout = true;
@@ -968,6 +969,11 @@ public function common_check_ipn_response($config = array()) {
968969
&& $storeOrderTotalCompare + 300 >= $billmateOrderTotalCompare
969970
) {
970971
// Set order as paid if paid amount matches order total amount
972+
if (version_compare(WC_VERSION, '2.0.0', '<')) {
973+
$redirect = add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink(get_option('woocommerce_thanks_page_id'))));
974+
} else {
975+
$redirect = $this->get_return_url($order);
976+
}
971977
$order->payment_complete();
972978
if ($this->order_status != 'default') {
973979
$order->update_status($this->order_status);
@@ -1109,13 +1115,14 @@ public function common_check_ipn_response($config = array()) {
11091115
}
11101116

11111117
if( $accept_url_hit ){
1112-
$redirect = '';
11131118
WC()->cart->empty_cart();
11141119
delete_transient($transientPrefix.$order_id);
1115-
if(version_compare(WC_VERSION, '2.0.0', '<')){
1116-
$redirect = add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink(get_option('woocommerce_thanks_page_id'))));
1117-
} else {
1118-
$redirect = $this->get_return_url($order);
1120+
if ($redirect == '') {
1121+
if (version_compare(WC_VERSION, '2.0.0', '<')) {
1122+
$redirect = add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink(get_option('woocommerce_thanks_page_id'))));
1123+
} else {
1124+
$redirect = $this->get_return_url($order);
1125+
}
11191126
}
11201127
WC()->session->__unset( 'billmate_checkout_hash' );
11211128
WC()->session->__unset( 'billmate_checkout_order' );
@@ -1129,10 +1136,12 @@ public function common_check_ipn_response($config = array()) {
11291136
if( $accept_url_hit ) {
11301137
// Remove cart
11311138
WC()->cart->empty_cart();
1132-
if(version_compare(WC_VERSION, '2.0.0', '<')){
1133-
$redirect = add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink(get_option('woocommerce_thanks_page_id'))));
1134-
} else {
1135-
$redirect = $this->get_return_url($order);
1139+
if ($redirect == '') {
1140+
if (version_compare(WC_VERSION, '2.0.0', '<')) {
1141+
$redirect = add_query_arg('key', $order->order_key, add_query_arg('order', $order_id, get_permalink(get_option('woocommerce_thanks_page_id'))));
1142+
} else {
1143+
$redirect = $this->get_return_url($order);
1144+
}
11361145
}
11371146
WC()->session->__unset( 'billmate_checkout_hash' );
11381147
WC()->session->__unset( 'billmate_checkout_order' );

0 commit comments

Comments
 (0)