Skip to content

Commit 257a3d4

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

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.5.1 - xxxx-xx-xx =
4+
* Fix - Fix fatal error when checking for a payment method availability using a specific order ID.
45

56
= 9.5.0 - 2025-05-13 =
67
* Fix - Fixes the listing of payment methods on the classic checkout when the Optimized Checkout 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
@@ -111,5 +111,6 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
111111
== Changelog ==
112112

113113
= 9.5.1 - xxxx-xx-xx =
114+
* Fix - Fix fatal error when checking for a payment method availability using a specific order ID.
114115

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

0 commit comments

Comments
 (0)