Sunday 28 March 2010

Configuring ZenCart and PayPal: Error 10413 solved

Now that PayPal is coming to South Africa, I figured that I’d upgrade my ZenCart site to connect to PayPal’s express checkout. 
I enabled ZenCart’s “PayPal Express Checkout” payment module and started configuring the parameters.
Oops, I needed to enter some API credentials – so I followed the instructions on how to get those.
I upgraded my PayPal account to “Premier” level so that I could accept payments and get an ‘API username’ and ‘API Password’ and ‘Signature’, and pointed it to “Sandbox” mode.
Sandbox mode? – yup, mmm… that should have got me thinking – but it didn’t. 
image
I then (naively) tried to process a transaction from my ZenCart using my real PayPal logins and got the following error “10002 Security error - Security header is not valid”.  That gave me further clues that I couldn’t use my real PayPal logins and API settings and use the “Sandbox” mode.  I needed to create new dummy accounts and logins and APIs on the sandbox.PayPal server.

imageSo, I registered as a developer on the https://developer.paypal.com/ site and downloaded the “PayPal_Sandbox_UserGuide” and a few clicks later I was creating the sandbox parameters and users that I could use to test my shopping cart.  I created a few users with different accounts, in different parts of the world, with lots of money so that they could purchase to their hearts’ content.
image
image

Then I got to the difficult part. I thought that it would be easy to go from the shopping cart to PayPal and process the payments – BUT, it wasn’t – sometimes the purchases went through fine – others it didn’t.  I didn’t realise that the small transactions worked fine – but not the ones over R1,000.  I kept on getting the error “10413 Transaction refused because of an invalid argument. See additional error messages for details. - The totals of the cart item amounts do not match order amounts.”  I Goggle’d a bit – but nothing really helped, until I found this posting by Levi Senft: “ZenCart and PayPal: 10413 Transaction refused because of an invalid argument. Solved!”.  The posting explains how the comma separator is the cause of the problems, as well as a fix.
image
I modified the paypalwpp.php file as directed and voila – it was solved.  No more error 10413 (that was really starting to haunt me!)

I’m looking forward to many transactions facilitated by PayPal in South Africa.

Update 07April2010:
I’m not sure why, but I started getting the 10413 error again.  Perhaps I didn’t test the above solution thoroughly enough.  I Google’d some more and found this solution by “gmail”: http://www.zen-cart.com/forum/showpost.php?p=675592&postcount=62:
PayPalZenCartError10413That seemed to work first time – but beware it’s not thoroughly tested.  You can download the modified paypalwpp.php file to save you some typing:  It INcludes both fixes described above  paypalwpp.php

If this still doesn’t help you – then look at the log files: /includes/modules/payment/paypal/logs (ensure that the folder is writable (ie: chmod 777))

I then had problems when shipping charges were included….
The same problem as “Zubey” had here.
Whenever tax was added to on either products or shipping. If tax is removed from both it all works fine.

[ITEMAMT] => 0.20
[AMT] => 0.20
[SHIPPINGAMT] => 0.00 **** when this = 0
[TAXAMT] => 0.00 & this = 0, all works fine ****
[L_NUMBER0] =>
[L_QTY0] => 1
[L_NAME0] => TEST Product No.2 $0.20
[L_AMT0] => 0.20

A bit more searching found me this article:
From http://www.zen-cart.com/forum/showpost.php?p=531979&postcount=7
and I changed these settings and it worked:
Config->My Store-> Basis of Product Tax=Shipping and Basis of Shipping Tax=Shipping
and in Module->Shipping (for each shipping module set): Tax Basis = Store

I hope this is the last time I say that “it’s working” and it isn’t!

1 comments:

  1. Thanks for this post. My employer occasionally encounters this error but often runs smoothly. He doesn't what causes it to be like that. It's really hard to troubleshoot things like this when it becomes so technical and basic knowledge is not enough.

    ReplyDelete

Share this article

Recent Posts by HandyTechTipper

HTT topics cloud

Money saving tips (93) tips (72) time saving tip (63) free (56) free programs (48) free software (48) free apps (46) Calculator (27) free services (27) Discovery Vitality (20) Skype (18) discount (18) Vodacom (16) Discovery credit card (15) Cape Town (14) SkypeOut (14) VOIP (14) cellphone (14) Discovery Health (13) International calls (12) SMS (11) Vodacom PrePaid (11) save electricity (11) saving electricity (11) Vodago (10) mobile Internet (10) reduce power usage (10) stop crime (10) ADSL (9) PrePaid ADSL (9) cash back (9) tagga (9) Electricity Usage Calculator (8) Firearm licence (8) neighborhood watch (8) Firearm license renewal (7) GPS (7) SIP (7) airtime (7) compare prices (7) credit card (7) firearm renewal (7) send free SMS (7) stolen goods (7) Firefox (6) Mugabe (6) Telkom (6) pre-paid electricity (6) solar heating (6) time switch (6) CellC (5) DIY (5) Eskom load shedding (5) MS office (5) Nokia N70 (5) Zimbabwe (5) anti-theft (5) best cell phone apps (5) flag as stolen (5) geyser (5) phishing (5) thermostat setting (5) 3G settings (4) Inflation (4) KeyFinder (4) Yebo4Less (4) free internet (4) gmail (4) life lesson (4) load shedding (4) second hand goods bill (4) time switch on your geyser (4) FIFa world cup soccer (3) Firefox3 (3) GPRS settings (3) Gun license renewal (3) Joomla (3) MS Outlook (3) MTN (3) Nokia (3) Nokia Navigator (3) Online backup (3) Robert Mugabe (3) TopTV (3) Twitter (3) ZenCart (3) cell phone contract (3) email to SMS (3) free email (3) free entry (3) free games (3) liquidation (3) save environment (3) scam (3) setup cell phone in South Africa (3) tourism (3) 567CapeTalk (2) Act (2) Bluetooth (2) Celine Dion (2) Concert (2) Edge settings (2) Linux (2) Lotto results (2) Opera to Firefox (2) WWE wrestling (2) backup (2) bank account (2) browser war (2) eTV wrestling (2) elderly (2) emoticons (2) event organising (2) excel (2) false advertising (2) funny (2) lotto (2) lotto plus results (2) mobile setup in South Africa (2) national lottery (2) personal email security (2) pre-emptive load shedding (2) privacy (2) save paper (2) second hand goods (2) software development (2) toll free (2) used goods (2) webcams (2) wooden bowl (2) 0800 (1) Asperger's (1) Eskom load shedding monitor (1) Google Earth (1) VAS rates (1) World Cup soccer 2010 (1) backup software (1) hoax (1) load shedding schedule (1) sql client (1)

www.priceisright.co.za

Live Traffic Feed

 

Be notified of
page updates
it's private
powered by
ChangeDetection

Copyright © 2008 HandyTechTipper. All articles are released under the Creative Commons Attribution 2.5 South Africa license, unless where otherwise stated.