razorpay / razorpay-woocommerce

Razorpay Payment Extension for Woocommerce
https://wordpress.org/plugins/woo-razorpay/
GNU General Public License v2.0
40 stars 30 forks source link

Bug: Checkout on WooCommerce charges people in INR when the currency should be USD. #560

Closed NerdvanaNC closed 2 months ago

NerdvanaNC commented 2 months ago

On my store with international payments enabled, customers are charged in USD. But now, since Razorpay has updated their checkout flow, people checking out with USD10 worth of items in their cart are charged INR10 instead. How can this even happen?

abdulwahidsharief commented 2 months ago

@NerdvanaNC please let me know the change in wordpress admin for currency. have you changed it in wordpress admin -> woocommerce -> settings-> general -> Currency

NerdvanaNC commented 2 months ago

razorpayCheckoutINR3

Confirmed - it is set to USD. I have made no changes to my website, which has been working for a long while already; the only change is in the checkout experience from Razorpay's end.

abdulwahidsharief commented 2 months ago

@NerdvanaNC can we please have a quick google meet call to understand the issue

abdulwahidsharief commented 2 months ago

@NerdvanaNC please provide replicating steps for the issue

NerdvanaNC commented 2 months ago

@abdulwahidsharief Yes, we can get on a Google Meet call or I can send you screencasts via email. How can I reach you?

abdulwahidsharief commented 2 months ago

@NerdvanaNC please share the screencasts include wordpress admin product pricing after currency change to USD and place one order in store(until rzp checkout modal opens). we can connect later if it is required.

NerdvanaNC commented 2 months ago

I have sent these details to you; did you receive my email?

abdulwahidsharief commented 2 months ago

@NerdvanaNC didn't received files can you please send here

NerdvanaNC commented 2 months ago

Email contains sensitive information I have sent again, please check inbox/spam folder. The subject line mentions "GitHub Issue #560. "

abdulwahidsharief commented 2 months ago

@NerdvanaNC didn't received email. please send here

NerdvanaNC commented 2 months ago

razorpayCheckoutINR2 razorpayCheckoutINR3 razorpayCheckoutINR4

ramth05 commented 2 months ago

@NerdvanaNC , Please provide the steps to reproduce it. Also help which version of plugin you are using in your site. Site url etc. Please raise a support ticket with Razorpay as well.

NerdvanaNC commented 2 months ago

There are no special steps to recreate this issue, I have been using Razorpay checkout plugin version 4.6.7.

My store is correctly configured (as seen in the earlier images). But Razorpay still proceeds to process checkout with INR as the currency. It should be USD.

NerdvanaNC commented 2 months ago

Fixed it myself.

Line 1130 of the file woo-razorpay.php in the function getDefaultCheckoutArguments( $order ).

Changed 'currency' => self::INR to 'currency' => 'USD'.

I don't know why the default arguments for checkout from an order are hardcoded to INR, but in any case, your implementation of the function getOrderCurrency( $order ) is faulty.

It's probably reverting back to the hardcoded value instead of returning an error. I don't really understand why you baked in a silent failure by hardcoding INR into the code.

I will keep trying to check and see if the implementation breaks, but it seemed to work just fine in my testing so far.

Thanks for nothing except for "please provide steps to reproduce bug" LMAO.