SecurePay Payment Module for ZenCart
A Secure Credit Cart Processing Gateway for SecurePay and ZenCart.
When I updated this module, I thought that I would be getting paid for it, entirely due to a misunderstanding on my part. As there was no formal agreement beforehand I cannot ask for it. I was going to ransom this module at first, in order to recoup part of the cost, but I’ve decided that I don’t want to deal with that right now-I’ve got way too many other issues to deal with.
I just ask that if you have the means, if you can donate to offset the lost wages and show your appreciation, it would be delightful.
So, here it is. This SecurePay payment module was updated and tested in ZC1.3.5, but it should work in older versions as well.
This is a pretty simple module feature-wise. It shows a credit card entry form on the payment checkout page, and when you confirm the order, sends the info to SecurePay.
If SecurePay returns an approval the order is processed.
If SecurePay returns a denial or cannot be contacted, the customer is told this and prompted to enter another card or choose an alternate payment method.
This module will store all cc info EXCEPT the actual credit card number, as that is a security issue. If someone needs this ability, feel free to contract my services to add it.
Note: A field for the CVV number is present, as it may be required by law in some places, but I was unable to determine if SecurePay supported that option. So the form takes the info and stores it in the order, but passes it on as a dummy field to SecurePay. Once they support it, I just have to change the dummy value to the actual field name they need for processing and it will work.
This module is being released as-is with no warranty/help included. You can post to this ZenCart Forum thread but I don’t guarantee I’ll be monitoring it (others might tho). For paid support, you can email email@example.com
Do note that SecurePay can’t really offer support for this module as it’s not their code-they may try to help you but they should not be your first call. They would only handle issues on their end, not this end.
Diner’s Club and JBC credit cards are in the code, but not enabled until I can verify SecurePay’s acceptance of these cards.
Credit Card CVV numbers are recorded, but not passed to SecurePay until I can verify the correct form field name for them.
This zip includes the following files. You should just be able to drop them in your catalog, but if unsure, I’ve included the destinations.
- Does not need to be added.
- [dest: /path/to/zenroot/securepay_handler.php]
- SecurePay.php (English language file)
- [dest: /includes/languages/english/modules/payment/SecurePay.php]
- SecurePay.php (Payment module)
- [dest: /includes/modules/payment/SecurePay.php]
- If you have installed an earlier version, please remove it.
- Unzip the files and drop into your catalog (The readme file does not need to be added).
- Log into your admin panel and go to Modules -> Payment.
- Click on the ‘SecurePay‘ line, then the ‘Install‘ button.
- Fill out the fields as directed.
The SecurePay Handler
SecurePay strips all variables from the return url (receipturl). Unfortunately, this means we can’t use the normal return method of pointing to index.php?page=checkout_process
To circumvent this, I’ve implemented a small handler file in the ZenCart root. All this file does is redirect to the checkout_process page. The path should be preset for you, but if needed, you can change it.
Testing the module
- Put the module in test mode and make an order.
- For the credit card number, enter Visa CC#: 4111111111111111
- This should get you a demo approved order (and the order goes through).
- Repeat, but this time use: Visa CC#: 4222222222222222
- This order should be rejected and you should be directed back to the payment page with an error message about the card being rejected/denied.
If both orders come back as expected, you should be good to go.