Skip to content

Commit 4c41e2a

Browse files
authored
Prevent "Undefined array key charges_enabled" PHP warning (#4494)
* Guard charges_enabled lookup to avoid PHP warning * Add changelog entries
1 parent 84d1b4c commit 4c41e2a

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
@@ -22,6 +22,7 @@
2222
* Fix - Set default values for custom field options
2323
* Fix - Enforce rate limiter for failed add payment method attempts
2424
* Update - Add the number of pending webhooks to the Account status section
25+
* Fix - Prevent "Undefined array key charges_enabled" PHP warning when determining live‑mode status
2526
* Update - Deprecate `wc_gateway_stripe_process_payment`, `wc_gateway_stripe_process_redirect_payment` and `wc_gateway_stripe_process_webhook_payment` actions in favour of `wc_gateway_stripe_process_payment_charge`
2627

2728
= 9.6.0 - 2025-07-07 =

includes/admin/class-wc-rest-stripe-account-controller.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ public function get_account_summary() {
134134
'supported' => $this->account->get_supported_store_currencies(),
135135
],
136136
'country' => $account['country'] ?? WC()->countries->get_base_country(),
137-
'is_live' => WC_Stripe_Mode::is_live() && $account['charges_enabled'] ?? false,
137+
'is_live' => WC_Stripe_Mode::is_live() && ( $account['charges_enabled'] ?? false ),
138138
'test_mode' => WC_Stripe_Mode::is_test(),
139139
]
140140
);

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
132132
* Fix - Set default values for custom field options
133133
* Fix - Enforce rate limiter for failed add payment method attempts
134134
* Update - Add the number of pending webhooks to the Account status section
135+
* Fix - Prevent "Undefined array key charges_enabled" PHP warning when determining live‑mode status
135136
* Update - Deprecate `wc_gateway_stripe_process_payment`, `wc_gateway_stripe_process_redirect_payment` and `wc_gateway_stripe_process_webhook_payment` actions in favour of `wc_gateway_stripe_process_payment_charge`
136137

137138
[See changelog for full details across versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)