Skip to content

Commit cde63b1

Browse files
wjrosaannemirasol
andauthored
Fix order currency fatal error (#4319)
* Fix order currency fatal error * Changelog and readme entries --------- Co-authored-by: Anne Mirasol <[email protected]>
1 parent e67c73e commit cde63b1

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
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.6.0 - xxxx-xx-xx =
4+
* Fix - Fix fatal error when checking for a payment method availability using a specific order ID.
45
* Fix - Stop checking for detached subscriptions for admin users, as it was slowing down wp-admin
56
* Update - Remove BACS from the unsupported 'change payment method for subscription' page.
67
* Fix - Fix payment method title display when new payment settings experience is enabled

includes/payment-methods/class-wc-stripe-upe-payment-method.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -287,9 +287,8 @@ public function is_enabled_at_checkout( $order_id = null, $account_domestic_curr
287287
$currencies = $this->get_supported_currencies();
288288
if ( ! empty( $currencies ) ) {
289289
if ( is_wc_endpoint_url( 'order-pay' ) && isset( $_GET['key'] ) ) {
290-
$order = wc_get_order( $order_id ? $order_id : absint( get_query_var( 'order-pay' ) ) );
291-
$order_currency = $order->get_currency();
292-
if ( ! in_array( $order_currency, $currencies, true ) ) {
290+
$order = wc_get_order( $order_id ? $order_id : absint( get_query_var( 'order-pay' ) ) );
291+
if ( ! $order || ! in_array( $order->get_currency(), $currencies, true ) ) {
293292
return false;
294293
}
295294
} elseif ( ! in_array( $current_store_currency, $currencies, true ) ) {

readme.txt

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

113113
= 9.6.0 - xxxx-xx-xx =
114114

115+
* Fix - Fix fatal error when checking for a payment method availability using a specific order ID.
115116
* Fix - Stop checking for detached subscriptions for admin users, as it was slowing down wp-admin
116117
* Update - Remove BACS from the unsupported 'change payment method for subscription' page.
117118
* Fix - Fix payment method title display when new payment settings experience is enabled

0 commit comments

Comments
 (0)