Skip to content

Commit 85dd070

Browse files
authored
Merge pull request #104 from woocommerce/fix/103-dont-override-value-of-other-payment-method
maybe_not_update_payment_method() returns unchanged value of $update if payment method is not Amazon Pay.
2 parents 65bdc29 + 460b9ca commit 85dd070

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
*** Amazon Pay Changelog ***
22

3+
= 2.0.4 - 2021-xx-xx =
4+
* Fix - Interference when subcsriptions' payment method changes to other payment method.
5+
36
= 2.0.3 - 2021-06-15 =
47
* Fix - Issues with state level handling of shipping zones.
58
* Fix - Issue that attempted to initialize the plugin in the REST API, throwing a fatal error.

includes/class-wc-gateway-amazon-payments-advanced-subscriptions.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -708,14 +708,14 @@ public function maybe_change_session_key( $session_key ) {
708708
*
709709
* @param bool $update Wether to Update.
710710
* @param string $method New method.
711-
* @return bool|string False if the gateway shouldn't update, the gateway id if it should be updated.
711+
* @return bool False if the gateway shouldn't update. True, otherwise.
712712
*/
713713
public function maybe_not_update_payment_method( $update, $method ) {
714714
$id = wc_apa()->get_gateway()->id;
715715
if ( $method === $id ) {
716716
return false;
717717
}
718-
return $id;
718+
return $update;
719719
}
720720

721721
/**

readme.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ Automatic updates should work like a charm; as always though, ensure you backup
5454

5555
== Changelog ==
5656

57+
= 2.0.4 - 2021-xx-xx =
58+
* Fix - Interference when subcsriptions' payment method changes to other payment method.
59+
5760
= 2.0.3 - 2021-06-15 =
5861
* Fix - Issues with state level handling of shipping zones.
5962
* Fix - Issue that attempted to initialize the plugin in the REST API, throwing a fatal error.

0 commit comments

Comments
 (0)