From eb0810c8cd395b26ef25989dfcbb2bfeccf3b4dd Mon Sep 17 00:00:00 2001 From: Mayisha <33387139+Mayisha@users.noreply.github.com> Date: Wed, 4 Sep 2024 13:24:37 +0600 Subject: [PATCH] Use custom order IDs in create intent request (#3398) * use 'order_id' from 'get_order_number' in stripe intent metadata --- changelog.txt | 1 + .../payment-methods/class-wc-stripe-upe-payment-gateway.php | 2 +- readme.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/changelog.txt b/changelog.txt index 2daf997b7..9941fa871 100644 --- a/changelog.txt +++ b/changelog.txt @@ -23,6 +23,7 @@ * Fix - Address QIT Security test errors. * Fix - Address QIT PHPStan test errors. * Update - Specify the JS Stripe API version as 2024-06-20. +* Tweak - Use order ID from 'get_order_number' in stripe intent metadata. * Fix - Ensure payment tokens are detached from Stripe when a user is deleted, regardless of if the admin user has a Stripe account. * Fix - Address Klarna availability based on correct presentment currency rules. diff --git a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php index 1be33b4bc..130a8f450 100644 --- a/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php +++ b/includes/payment-methods/class-wc-stripe-upe-payment-gateway.php @@ -1730,7 +1730,7 @@ public function get_metadata_from_order( $order ) { 'customer_name' => $name, 'customer_email' => $email, 'site_url' => esc_url( get_site_url() ), - 'order_id' => $order->get_id(), + 'order_id' => $order->get_order_number(), 'order_key' => $order->get_order_key(), 'payment_type' => $payment_type, ]; diff --git a/readme.txt b/readme.txt index be3d7273b..14a403e41 100644 --- a/readme.txt +++ b/readme.txt @@ -151,6 +151,7 @@ If you get stuck, you can ask for help in the Plugin Forum. * Fix - Address QIT Security test errors. * Fix - Address QIT PHPStan test errors. * Update - Specify the JS Stripe API version as 2024-06-20. +* Tweak - Use order ID from 'get_order_number' in stripe intent metadata. * Fix - Ensure payment tokens are detached from Stripe when a user is deleted, regardless of if the admin user has a Stripe account. * Fix - Address Klarna availability based on correct presentment currency rules.