Skip to content

Commit a3c43ab

Browse files
authored
Fix warning notice related to subscriptions helper (#4020)
* Fix warning notice related to the new subscriptions helper * Checking for an empty value instead * Changelog and readme entries
1 parent 7115a92 commit a3c43ab

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*** Changelog ***
22

33
= 9.3.0 - xxxx-xx-xx =
4+
* Fix - Improves the checking for existing customer attribute when retrieving a payment method that may be detached from a subscription.
45
* Fix - Reverts the default value for the `capture_method` property to avoid breaking Amazon Pay when creating a payment intent.
56
* Add - Adds a new feature flag to handle the Single Payment Element feature.
67
* Dev - Moves the method to check if the subscriptions extension is enabled to a new helper class.

includes/compat/class-wc-stripe-subscriptions-helper.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public static function get_detached_subscriptions() {
4848
$source_id = $subscription->get_meta( '_stripe_source_id' );
4949
if ( $source_id ) {
5050
$payment_method = WC_Stripe_API::get_payment_method( $source_id );
51-
if ( ! $payment_method->customer ) {
51+
if ( empty( $payment_method->customer ) ) {
5252
$detached_subscriptions[] = [
5353
'id' => $subscription->get_id(),
5454
'customer_id' => $subscription->get_meta( '_stripe_customer_id' ),

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
111111
== Changelog ==
112112

113113
= 9.3.0 - xxxx-xx-xx =
114+
* Fix - Improves the checking for existing customer attribute when retrieving a payment method that may be detached from a subscription.
114115
* Fix - Reverts the default value for the `capture_method` property to avoid breaking Amazon Pay when creating a payment intent.
115116
* Add - Adds a new feature flag to handle the Single Payment Element feature.
116117
* Dev - Moves the method to check if the subscriptions extension is enabled to a new helper class.

0 commit comments

Comments
 (0)