Jump to content



Photo

paypal changes from GBP to USD


  • Please log in to reply
9 replies to this topic

#1   dicko_md

dicko_md
  • Members
  • 36 posts
  • Real Name:Martyn

Posted 08 November 2011 - 23:37

Hi

Since I updated to the add on Discount Code 3.1 for osCommerce 2.3.1 when I go from the site where everything is in GBP it changes to USD on paypal.

I have looked through all the files and cannot see anything that says USD or US$.

Has this happened to anyone else ?

I read that there is a script you can run to echo what is actually been sent to paypal.....is this true to see if its a paypal issue ?

Any ideas/fixes would be greatly appreciated

Martyn

#2   DunWeb

DunWeb

    The Censored One

  • Members
  • 13,084 posts
  • Real Name:Chris
  • Gender:Male
  • Location:Ontario, Canada

Posted 08 November 2011 - 23:56

Martyn,

In the /includes/languages/english.php file around line 40 you will see this:

// if USE_DEFAULT_LANGUAGE_CURRENCY is true, use the following currency, instead of the applications default currency (used when changing language)
define('LANGUAGE_CURRENCY', 'USD');

Change it to GBP

Also, ensure your PayPal account is setup to accept all currencies as USD is the default.




Chris
:|: Was this post helpful ? Click the LIKE THIS button :|:

See my Profile to learn more about add ons, templates, support plans and custom coding (click here)

#3   Spirantho

Spirantho
  • Members
  • 1 posts
  • Real Name:Ian Gledhill

Posted 14 December 2011 - 13:55

Hi,

(First post here - so I hope it's right!)

I had the same problem.
I fixed it by going to catalog/ext/modules/payment/paypal/express.php.
Find the new line added by the module:
$params = array();
and change it to
$params = array('CURRENCYCODE' => $order->info['currency']);

It seems to override the old amount by creating a new array, and in doing so doesn't take into account the currency used. So the line after it:
$response_array = $paypal_express->setExpressCheckout($params);
uses the array which only has the amount in it. Hence PayPal defaults to USD as it's American. That's my understanding of it anyway!

I have no idea how to notify the author of this bug (or indeed if I've actually found the correct fix but it seems ok so far!)

#4   paccman

paccman
  • Members
  • 7 posts
  • Real Name:emile

Posted 29 December 2011 - 20:01

I had the same problem and emailed the conributor.

He gave me the fix:


Thank you for your interest in our product.

Please modify the catalog/ext/modules/payment/paypal/express.php file.

Find:

$params = array();
$params['AMT'] = $paypal_express->format_raw($order->info['total'], '', 1);

Replace with:

$params = array('CURRENCYCODE' => $order->info['currency']); $params['AMT'] = $paypal_express->format_raw($order->info['total']);

Sincerely,
The High Quality PHP Coding Team.

#5   raj303

raj303
  • Members
  • 5 posts
  • Real Name:Rajesh

Posted 30 April 2012 - 09:32

Hi

Since I updated to the add on Discount Code 3.1 for osCommerce 2.3.1 when I go from the site where everything is in GBP it changes to USD on paypal.

I have looked through all the files and cannot see anything that says USD or US$.

Has this happened to anyone else ?

I read that there is a script you can run to echo what is actually been sent to paypal.....is this true to see if its a paypal issue ?

Any ideas/fixes would be greatly appreciated

Martyn

I wanted this bug as features.
I set my currency as INR in english.php but when doing paypal express checkout it says currency not supported.
ok, fine.
I want currency should get converted automatically to USD when user use paypal express check out.
how to do that?

#6   Paul Baglin

Paul Baglin
  • Members
  • 7 posts

Posted 02 May 2012 - 13:04

I had the same problem and emailed the conributor.

He gave me the fix:


Thank you for your interest in our product.

Please modify the catalog/ext/modules/payment/paypal/express.php file.

Find:

$params = array();
$params['AMT'] = $paypal_express->format_raw($order->info['total'], '', 1);

Replace with:

$params = array('CURRENCYCODE' => $order->info['currency']); $params['AMT'] = $paypal_express->format_raw($order->info['total']);

Sincerely,
The High Quality PHP Coding Team.


Was just looking for a solution to the problem as I've just installed 3.1 and this works perfectly, thanks!

#7   frankcat

frankcat
  • Members
  • 15 posts
  • Real Name:Martin Barron

Posted 25 September 2012 - 20:02

Cannot find the above code on my page

My file is paypal_express.php


<?php
/*
$Id$

osCommerce, Open Source E-Commerce Solutions
http://www.oscommerce.com

Copyright © 2009 osCommerce

Released under the GNU General Public License
*/

chdir('../../../../');
require('includes/application_top.php');
require('../includes/modules/payment/paypal_express.php');

if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'test')) {
if (defined(MODULE_PAYMENT_PAYPAL_EXPRESS_STATUS)) {
$paypal_express = new paypal_express();

$params = array('CURRENCYCODE' => DEFAULT_CURRENCY,
'AMT' => '1.00');

$response_array = $paypal_express->setExpressCheckout($params);

if (($response_array['ACK'] == 'Success') || ($response_array['ACK'] == 'SuccessWithWarning')) {
echo '<h1>Success!</h1>';

if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {
echo '<p>The PayPal Express Checkout credentials have been set up correctly for live production use.</p>';
} else {
echo '<p>The PayPal Express Checkout credentials have been set up correctly for the sandbox environment.</p>';
}
} else {
echo '<h1>Failure!</h1>';

if (MODULE_PAYMENT_PAYPAL_EXPRESS_TRANSACTION_SERVER == 'Live') {
echo '<p>The PayPal Express Checkout credentials are not set up correctly for live production use.</p>';
} else {
echo '<p>The PayPal Express Checkout credentials are not set up correctly for the sandbox environment.</p>';
}

echo '<pre>';
var_dump($response_array);
echo '</pre>';
}
} else {
echo '<p>The PayPal Express Checkout payment module is not yet installed. Please install it to verify your API credentials.</p>';
}
}
?>




Anyone help??

Cheers
Martin

#8   frankcat

frankcat
  • Members
  • 15 posts
  • Real Name:Martin Barron

Posted 26 September 2012 - 18:27

Any ideas?????????

#9   elsmore1

elsmore1
  • Members
  • 2 posts
  • Real Name:Richard Elsmore

Posted 07 October 2012 - 19:56

Hi,

I also have a problem when users click to buy a product from my site it appears as USD in paypal, although my site is in GBP. My site was set up by someone else and they have not replied yet to me, but I only have the \admin site to use, is this were I can amend the code? I have used the osCommerce site mainly to add products, so I did not set up from scratch.

Thanks for any advice

#10   AdamArscott

AdamArscott
  • Members
  • 4 posts
  • Real Name:Adam Arscott

Posted 03 November 2012 - 15:14

I had the same problem and emailed the conributor.

He gave me the fix:


Thank you for your interest in our product.

Please modify the catalog/ext/modules/payment/paypal/express.php file.

Find:

$params = array();
$params['AMT'] = $paypal_express->format_raw($order->info['total'], '', 1);

Replace with:

$params = array('CURRENCYCODE' => $order->info['currency']); $params['AMT'] = $paypal_express->format_raw($order->info['total']);

Sincerely,
The High Quality PHP Coding Team.


Thanks for this, I have applied this fix and it solved my problem. However I am having a problem that on the PayPal page it just shows the total, not the break down of shipping, tax etc. I am new to PHP but my guess would be in the $order->info['total'} part, do I need to add shipping, tax and discount to this?