Jump to content

Paypal return currency error


Recommended Posts

Hello,

Thanks to this wonderful software. I'm new to Presta shop and I'm testing version 1.1.

I've setup Paypal checkout with USD and my default currency is Thai Baht (Thai Baht).

When I checkout using Paypal, THB is converted to USD correctly. After successful payment, when I return to prestashop, I get payment error. although the payment is successful.

This is because prestashop is not converting USD to default currency (THB) on return.

For example. Say I order something for 70 THB. On paypal checkout it converts to USD 2 (1 USD = ~35 THB). After successful payment and return to prestashop, the admin Orders page says,

Warning: THB 2 paid instead of THB 70 !

What should happen is that on return, prestashop should convert USD into THB.

I tried looking at the code (I'm a rusty PHP programmer). In validation.php I see the following snippet,


else
{
$currency = $paypal->getCurrency();
$price = floatval($_POST['mc_gross']);
if (intval($currency->id) != intval(Configuration::get('PS_CURRENCY_DEFAULT')))
$price *= 1.0 / floatval($currency->conversion_rate);
$paypal->validateOrder($_POST['custom'], _PS_OS_PAYMENT_, $price, $paypal->displayName, $paypal->getL('transaction').$_POST['txn_id']);
}


It seems to be doing the conversion? What is wrong?

Thanks in advance,
Canand

Link to comment
Share on other sites

  • 2 weeks later...

Hi there,


Ive read about the same issues in the forum from some older posts.
I'm also experiencing some related issues possibly to Paypal module or Presta such as stock quantity not changing, and orders not appearing in the back office, (I'm only using the Paypal module). I assume I'll get the same problems with Paypal when I get orders from other countries.

Paul

Link to comment
Share on other sites

  • 4 weeks later...

Go to "Payment module restrictions - Currencies restrictions" see the "Please mark the checkbox(es) for the currency or currencies in which you want the payment module(s) available" and let PayPal to work only with "Shop default currency" and currency error is away.

Link to comment
Share on other sites

×
×
  • Create New...