Friday 4 July 2014

INR currency convert issue with paypal payment method in magento


INR currency convert issue with paypal payment method in magento

Many people facing this issue when customer redirect at paypal payment gateway with INR currency , paypal does not convert Indian currency to USD or any. Here is the little solution that i have mentioned...

Go to app/code/core/Mage/Paypal/Block/Standard/Redirect.php

You can see below foreach loop in this file

foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {

$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));

}


Just replace above foreach loop with this

foreach ($standard->getStandardCheckoutFormFields() as $field=>$value) {
if($field == 'amount_1'):
$from = 'INR';
$to = 'USD';
$price = $value;
$newPrice = number_format(Mage::helper('directory')->currencyConvert($price, $from, $to),2);
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$newPrice));
elseif($field == 'amount_2'):
$from = 'INR';
$to = 'USD';
$price = $value;
$newPrice = number_format(Mage::helper('directory')->currencyConvert($price, $from, $to),2);
$form->addField($field, 'hidden', array('name'=>$field, 'value'=>$newPrice));
else:
           $form->addField($field, 'hidden', array('name'=>$field, 'value'=>$value));
endif;
       }

Thats it.... Enjoy Chandresh rana's Coding... :)

20 comments:

Anonymous said...

Hello Chandresh,

Thank for such great post..

pls help me in following case..

I have set Base currency as Indian Rupee.

At that time PayPal Standard method doesn't seem on checkout page.

While I set base currency US Dollar then it works perfect.

But In my live store my base currency set as Indian Rupee. And in this case I want to show paypal method on checkout page...

please help me....

PHP Coder said...

Hey Mate,

Here is your answer link :

http://chandreshrana.blogspot.in/2013/12/paypal-payment-method-not-display-with.html

Unknown said...

Hello,

Please help me.. Tax rate is not converting to USD. How to convert it also.

Thanks

aniket dixit said...

Chandresh bhai,
great post.

Thank you very much. It worked perfectly for me.
-
Aniket
website : www.crickstore.com

BM Loft said...

After replace the code, facing the below error while redirect to paypal page. Kindly help

Call to a member function getCode() on a non-object in /home/shopmaac/public_html/app/code/core/Mage/Directory/Model/Currency.php

PHP Coder said...

Hello Mansoor,

In my code i have not used any getCode() function please check it once again...

Thanks,
Chandresh

BM Loft said...

Hi Chandresh,

First of all Thanks lot for quick response. I am not a coder, just a designer in magento. I did nothing in code's just replaced the above code. If i revert to original code the paypal page opening successfully. Kindly help

Anonymous said...

The code is working fine but its not working on tax. Do you have solution ?

amit said...

Hi Chandresh!

I am facing same issue on my website. Can u resolve the issue ? I can pay for your services

I am loosing my business due to this issue.

PHP Coder said...

Please specify your website url here...

Anonymous said...

www.luckycharm.in
www.devshoppe.com

Anuj said...

YOU HAVE DONE A GREAT JOB HERE. I have my own portal on Magento and paypal integration issue still exists, some other issues are also there. I request you to connect me back and sort these issues. I am ready to pay you for your work. It is little urgent.

Awaiting response.
Anuj

Anonymous said...

Hi, Chandresh

I have used your code from here"http://chandreshrana.blogspot.in/2014/07/inr-currency-convert-issue-with-paypal.html" but it's still giving me the same error as "PayPal gateway has rejected request. Currency is not supported (#10605: Transaction refused because of an invalid argument. See additional error messages for details)."
Please tell me if i have missed anything.
Thanks in advance!

Niky Jackson said...

i have added your code. but now i am getting this message??

PayPal gateway has rejected request. Currency is not supported (#10605: Transaction refused because of an invalid argument. See additional error messages for details).

Do you have solution how to solve this??

Westzone Solution said...

PayPal gateway has rejected request. Currency is not supported (#10605: Transaction refused because of an invalid argument. See additional error messages for details).

Anonymous said...

Please help me to solve this error...
PayPal gateway has rejected request. Currency is not supported (#10605: Transaction refused because of an invalid argument. See additional error messages for details).
I am getting this when I am choosing payment method as paypal.
Tried almost every thing but nothing is working.
I want Base current as AED.Please reply ASAP.

Thanks in advance.

Anonymous said...

can you please explain, what "amount_1" & "amount_2" refers? should it will be change with actual price value or the code is placed as it is?

Unknown said...

Hello Chandresh,

Thank for such great post..

pls help me in following case..

I have same problem with opencart paypal express payment getway.

I have set Base currency as Indian Rupee.

At that time PayPal express method doesn't seem on checkout page.

While I set base currency US Dollar then it works perfect.

I want to paypal page show INR converted in US Dollar.
Please Give me suggestion.
Thanks

Unknown said...

Hello Sir,

I have same problem in opencart 2.2.
I want to INR value to redirect with convert in US Dollar in Paypal express checkout page.

Please help me how to convert and send INR to US Dollar.

While I set base currency US Dollar then it works perfect.

But In my live store my base currency set as Indian Rupee. And in this case I want to show paypal method on checkout page...

please help me....

Anonymous said...

Inform us which PayPal account to use.