Showing posts with label ZenCart. Show all posts
Showing posts with label ZenCart. Show all posts

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!

Monday, 22 March 2010

Payment gateways for web sites in South Africa

This article is about the pains and difficulties that I’ve experienced in trying to integrate ZenCart with a (credit Card) payment gateway in South Africa.  There has been a lot of talk about which shopping cart software to use (ZenCart, VirtueMart, osCommerce, Comersus, CubeCart, WHMCS, WP eCommerce, UberCart).  I’ve decided to use ZenCart and VirtueMart – mainly because I’ve needed them integrated into a Content Management System (CMS) – but that’s another story.

image image image image image image image

The criteria for choosing a payment gateway were (in order of priority):
* Based in South Africa
* easy (or cheap, off-the-shelf) integration with ZenCart
* low or zero monthly charges
* no charges until the site went into production
* competitive commissions on credit card transactions
* competitive per transaction fees

Our e-commerce site was going to be a low volume site to start with – so the monthly costs were the scary part and I was on the lookout for a zero monthly fee gateway…

When designing my e-Commerce site, I Google’d around and saw that there seemed to be a working, off-the-shelf integration module for ZenCart-and-NetCash and some reviews saying that it was a relatively easy integration.

The MacGeek site had a discussion “Payment gateways for websites in South Africa – a crowdsourcing experiment” that brought together some frustrated developers trying to find the best services. 
There was also a ZenCart plugin to NetCash for R100 and others – but that site and software is no longer available (or didn’t work?).  Various people complained that although the plugin processed the payment, it did not record the payment or the order in the order page in the ZenCart admin page, it did not send an email detailing the order to the administrator or the client, so a payment is made without knowledge of the administrator. VERY frustrating.

PayPal is an option – especially with FNB’s announcement that it would be representing PayPal in South Africa – but when?  For now – I looked around and here’s what I found:

 image
The http://ecommerce-guide.co.za/ has very useful information and this is where I think I started smiling :)
The article “New developments on the super merchant front and announcement of PayPal launch in SA” lists a few options: PayFast: offering credit card payment facility and a PayFast voucher system to their existing instant EFT and Ukash payment options and also offer free payment modules – see below for links to download them for free!  

Setcom have separated and rebranded their services and their super merchant service is now called MonsterPay. Setcom is now solely the credit card payment gateway service for online retailers with bank merchant accounts, and SID (or Secure Instant Deposit) is their web-based instant EFT service.


image 

image
PayFast have free payment modules (click to download them) for ZenCart 1.3.8a, VirtueMart 1.1.3, VirtueMart 1.0.15osCommerce 2.2, CubeCart 4.3.0, CubeCart 3.0.18, WHMCS 4.1.2, WP eCommerce 3.7.5.
I must say, PayFast have HTT’s endorsement for a very well thought out web site – very informative and I had my ZenCart integrated with PayFast’s payment gateway in less than 2 hours!  Free driver, well written “Integration Guide” with test logins and passwords available on the web site – wonderful!  (Hat-tip to the technical team @ PayFast).  Oh, and their driver worked flawlessly – with a gr8 ZenCart install package.  This is the only driver that HTT actually installed and tested – no need to look any further – unless one of the other vendors would like me to do that for them?
Rates are very good too – with no monthly fee, no setup fee.  Just a transaction fee (R2) and competitive commission (4.9%). Excl. VAT.

image
Mygate have free payment modules (click to download them) for OsCommerce, Joomla with VirtueMart Version 1.0.12, Joomla with VirtueMart Version 1.5.3, Cube Cart, Cube Cart version 4, ZenCart, Comersus


image
Setcom have free payment modules for OsCommerce module and ZenCart module.
BUT, fees: there’s a monthly fee (R250), setup fee (R250).


image
PayGate have free payment modules: OSCommerceZenCart, VirtueMart, Drupal Ubercart, CS-Cart
Pricing is provided on request (after filling out a form – WTF!)

image
NetCash: As mentioned above, this is where I started my journey – thinking that there was a cheap (R100) plugin for NetCash and ZenCart – but, when I tried it, I was horribly disappointed.  I landed up wasting a few long frustrating nights doubting my ZenCart (and php) skills.  The plugin processed the payment, BUT it did not record the payment nor the order in the order page in the ZenCart admin page, and it did not send an email detailing the order to the administrator or the client, so a payment is made without knowledge of the administrator. VERY frustrating.  It was then that I started looking for another driver and came across these other free payment modules.  The other vendors have woken up to the need to make integration to their gateways a painless (and seamless) exercise. 
NetCash – here’s some constructive advice: best you wake up and provide drivers similar to the quality of PayFast - else I doubt whether you’ll get very many eCommerce sites connecting up.
Fees: R160 monthly fee (only kicks in after your first real transaction); R1.00 per transaction; Commission on Credit Card transactions 5.0%


image 
Moneybookers: Also has free integration modules.  See here for the list
Fees are very low too: 2.9%: Merchant fees  and other rates
No monthly fees, no setup charges.

Sunday, 21 February 2010

Joomla! site pains and the solutions that worked for me: “Error 500”, “Error 404.2” - The White Screen of Death

I was playing around and trying to turn on a SEF module in Joomla! then everything stopped working :(
Not sure if the SEF and the problems were related, but my Joomla! site gave errors and even showed blank pages (white screen of death).
It seemed like some files were not accessible so I tried to change the file permissions but that didn’t help - “500 'SITE CHMOD 777 modules': command not understood”.  Seemed like that’s correct when running on Microsoft IIS (version 6).

I then thought that these files were the problem since I couldn’t open them: .htaccess .htgroup and .htpasswd

image
The I asked the webmaster to check the site and he found a problem: “each site running PHP has to have a specific mapping to the php5isapi.dll file and for some reason, this was changed to point to the php.exe file. ”

Here’s a nice article that helped check the settings on IIS 6: How To Install PHP on IIS 6.0 

I have found a way of turning on error logging on the index page’s screen (from “The White Screen of Death (Completely Blank Page)
Just temporarily edit your index.php file (normally located in your Joomla! root directory) directly after the first opening PHP tag to add the following:
===============
<?php

error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);

===============
image
I’ve turned it on and I think this will give clues as to what’s going on.  So far there’s a file that’s not accessible – now to contact the web master to see what’s going on with that file’s accessibility


image
Are you a ZenCart page designer?
Turning on error logging for ZenCart php would also save lots of time: enable_error_logging.php
Extracted from: Debug Error-Logging Utility for PHP and Zen Cart:

Installing the debug error-logging tool will create debug logs of PHP problems for you to review.
Be sure to remove the utility when not needed, or it will slow down your site and consume large amounts of disk space.

** HOW TO USE: **
1. Download and unzip the utility
2. Upload the enclosed enable_error_logging.php file to the /includes/extra_configures/ folder.
3. Test the page on your site that is having problems -- ie: trigger whatever symptom is ailing you.
4. Open the latest log file /cache/myDEBUG-xxxxxxx.log to see the list of any PHP errors that occurred while the page/test was running.
5. Be sure to delete the enable_error_logging.php file from the /includes/extra_configures folder when done (or rename it to .php1 instead of .php )

Update on 28Mar2010:
If you are getting errors trying to integrate ZenCart with PayPal’s express checkout: 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.”  See here for how to solve it by modifying the paypalwpp.php file: Configuring ZenCart and PayPal: Error 10413 solved

image

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.