Setting up Paypal IPN with osCommerce for Australian Dollars (AUD)

9 comments

This post is an old post from my previous blog but I thought it might be still useful to some people so I'll repost it here rather than deleting it.

I have just been setting up an osCommerce website to use Paypal's IPN as the payment method to accept credit card and paypal payments. I downloaded the official osCommerce Paypal IPN module from the contributions site, because the one that comes with 2.2MS2 is out of date.

After downloading this and installing it, I made a test order on the osCommerce store, and when I was directed to Paypal the amount to pay was $0.00 USD. As this is an Australian site, dealing in Australian currency (AUD) only, there were 2 problems. The zero order amount, and the fact that it was in USD.

I eventually tried adding in the USD currency into my osCommerce shop, and tried another test order. This one was more successful, as it showed an amount (albeit in USD) that was ordered. The thing I noted was that the amount shown was using the exchange rate I had set in osCommerce, and not just calculated by Paypal.

So after some more digging I came across the following code in the /catalog/includes/modules/payment/paypal_ipn.php file on lines 261-263.

if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD'))) {
     $my_currency = 'USD';
}

For some reason the developers of the module (osCommerce team) decided that AUD wasn't a currency supported by Paypal (and maybe it wasn't when they first released it in late 2004), but it definitely is. So a simple hack to the code like this fixed my problem, and now sends the correct amount to Paypal in Australian Dollars.

if (!in_array($my_currency, array('CAD', 'EUR', 'GBP', 'JPY', 'USD', 'AUD'))) {
     $my_currency = 'USD';
}

That's it, your osCommerce store should now be able to accept Australian Dollars with PayPal.


Comments

Use Module from RC2a

Hi,

In latest stable version (rc2a) of osCommerce that already have very nice paypal IPN module.

You can copy that module to any other backward version.

Thanks
Jayesh Patel

Customers need such special

Customers need such special training about these services offered by the paypal. The conversing currency is the common operation sought by the users. Yours is an excellent lesson on this regard.

I am glad to learn about this

I am glad to learn about this valuable lesson on setting up paypal ipn with os commerce for Australian dollars. It is an excellent example too. thanks.

Though we've been using the

Though we've been using the feature in our financial activities, but have never thought about its functioning. Thank for the nice tutorial in this regard.

In the day to day financial

In the day to day financial transactions, we very much feel the need of this feature. It would be a refreshing post for a developer.

It is good to see Paypal IPN

It is good to see Paypal IPN with osCommerce for Australian dollars in operation since 2.2MS2 is out of date. It is a very useful information.

Thanks a lot for posting such

Thanks a lot for posting such a useful method to fix the problem by setting up Paypal IIPN with osCommerce for Australian Dollars. I think it has saved me a lot of time and energy.

Setting up Paypal IPN

Toady, internet has become huge market platform for any type of business. There are lots online store created on internet for selling online. So store owners have to need online payment system for their store. They mostly use Paypal for online payment and this is the great post for them to inform that how they can set the Paypal system for online payment on their site.

Setting up Paypal IPN

Toady, internet has become huge market platform for any type of business. There are lots online store created on internet for selling online. So store owners have to need online payment system for their store. They mostly use Paypal for online payment and this is the great post for them to inform that how they can set the Paypal system for online payment on their site.

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options