From 098bbee5872cc98993960d007c385e9c24bbf294 Mon Sep 17 00:00:00 2001 From: Razorpay Date: Thu, 13 Jun 2024 18:17:15 +0530 Subject: [PATCH 1/2] PO-136 remove default currency as INR --- woo-razorpay.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/woo-razorpay.php b/woo-razorpay.php index df1af7fd..658f70f6 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -1127,7 +1127,7 @@ public function getDefaultCheckoutArguments($order) return array( 'key' => $this->getSetting('key_id'), 'name' => html_entity_decode(get_bloginfo('name'), ENT_QUOTES), - 'currency' => self::INR, + 'currency' => $this->getOrderCurrency($order), 'description' => $productinfo, 'notes' => array( self::WC_ORDER_ID => $orderId, @@ -1160,8 +1160,6 @@ private function getCheckoutArguments($order, $params) { $args = $this->getDefaultCheckoutArguments($order); - $currency = $this->getOrderCurrency($order); - // The list of valid currencies is at https://razorpay.freshdesk.com/support/solutions/articles/11000065530-what-currencies-does-razorpay-support- $args = array_merge($args, $params); From 4e648e38ef9c6697fdb5baacc57f4b83a801bab9 Mon Sep 17 00:00:00 2001 From: Razorpay Date: Fri, 14 Jun 2024 18:42:07 +0530 Subject: [PATCH 2/2] reverted default currency and added currency merge --- woo-razorpay.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/woo-razorpay.php b/woo-razorpay.php index 658f70f6..f085b195 100644 --- a/woo-razorpay.php +++ b/woo-razorpay.php @@ -1127,7 +1127,7 @@ public function getDefaultCheckoutArguments($order) return array( 'key' => $this->getSetting('key_id'), 'name' => html_entity_decode(get_bloginfo('name'), ENT_QUOTES), - 'currency' => $this->getOrderCurrency($order), + 'currency' => self::INR, 'description' => $productinfo, 'notes' => array( self::WC_ORDER_ID => $orderId, @@ -1160,6 +1160,13 @@ private function getCheckoutArguments($order, $params) { $args = $this->getDefaultCheckoutArguments($order); + $currency = $this->getOrderCurrency($order); + + if (empty($currency) === false) + { + $args['currency'] = $currency; + } + // The list of valid currencies is at https://razorpay.freshdesk.com/support/solutions/articles/11000065530-what-currencies-does-razorpay-support- $args = array_merge($args, $params);