Commit 746f61dfe8 for woocommerce
commit 746f61dfe8e1d267a36c5ab9aeba8cd06d1fa242
Author: Mayisha <33387139+Mayisha@users.noreply.github.com>
Date: Tue Dec 2 16:39:24 2025 +0600
PayPal Standard: Include WC version in PayPal custom_id (#62142)
* include wc version in custom id
* use 'v' for version
* update test
diff --git a/plugins/woocommerce/changelog/62142-tweak-add-wc-version-in-paypal-custom-id b/plugins/woocommerce/changelog/62142-tweak-add-wc-version-in-paypal-custom-id
new file mode 100644
index 0000000000..87e43b87e4
--- /dev/null
+++ b/plugins/woocommerce/changelog/62142-tweak-add-wc-version-in-paypal-custom-id
@@ -0,0 +1,4 @@
+Significance: patch
+Type: update
+
+Include WooCommerce version in PayPal Standard gateway requests.
\ No newline at end of file
diff --git a/plugins/woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php b/plugins/woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php
index ef8ecf109d..f5bd386256 100644
--- a/plugins/woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php
+++ b/plugins/woocommerce/includes/gateways/paypal/includes/class-wc-gateway-paypal-request.php
@@ -574,6 +574,7 @@ class WC_Gateway_Paypal_Request {
// Endpoint for the proxy to forward webhooks to.
'site_url' => home_url(),
'site_id' => class_exists( 'Jetpack_Options' ) ? Jetpack_Options::get_option( 'id' ) : null,
+ 'v' => WC_VERSION,
)
);
diff --git a/plugins/woocommerce/tests/php/includes/gateways/paypal/class-wc-gateway-paypal-request-test.php b/plugins/woocommerce/tests/php/includes/gateways/paypal/class-wc-gateway-paypal-request-test.php
index 23f970ed8a..c678a7ef9c 100644
--- a/plugins/woocommerce/tests/php/includes/gateways/paypal/class-wc-gateway-paypal-request-test.php
+++ b/plugins/woocommerce/tests/php/includes/gateways/paypal/class-wc-gateway-paypal-request-test.php
@@ -133,6 +133,7 @@ class WC_Gateway_Paypal_Request_Test extends \WC_Unit_Test_Case {
$this->assertArrayHasKey( 'order_key', $custom_id );
$this->assertArrayHasKey( 'site_url', $custom_id );
$this->assertArrayHasKey( 'site_id', $custom_id );
+ $this->assertArrayHasKey( 'v', $custom_id );
return $this->create_paypal_order_success( $value, $parsed_args );
}