| | | |

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';
}

If you are having trouble getting your Paypal processing to work with your osCommerce shop, or have any questions relating to osCommerce, contact me through my brisbane website design company, and I'll be more than happy to help out.

Trackback URL for this post:

http://www.nickschoonens.com/trackback/10

IPN issue

Nick,
I am having great problems with this module and i am hoping you can help work this out.

Simply the transaction goes through perfectly however the IPN is not sent back to Oscommerce.

I recieve no confirmation at all.

An ideas why?

ilan

Simple - Easy Answer

Thanks Nick,

Sorted my issues on http://www.virtualpoolstore.com.au/store/catalog/

Not only did it sort my pay-pal $0.00 problem, it was a simple fix too.

Cheers,

Paul.

Cheers Mate!

I came across the same problem, decided to google first before digging in. This solved my problem. Many thanks.

Know how to make the GST component add automatically in each product's cost? Hrmm ;-)