Australian payment gateway extension
Posted: 17 January 2008 06:41 AM   [ Ignore ]
Jr. Member
RankRank
Total Posts:  37
Joined  2007-04-26

Hi all

I have been working with a developer to add functionality to FreeForm via it’s hooks.

We have developed an extension which enables freeform payments through Eway, an Australian payment gateway.

You can see the form in action here:
https://www.tear.org.au/donate/giving/

If there is any interest in this, and if it’s ok with the Solspace people, I will post further info and files.

Blessings
- Ad

Profile
 
 
Posted: 17 January 2008 08:27 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  3343
Joined  2006-10-18

Sure! I’d love to see how you’ve done this smile

 Signature 
Profile
 
 
Posted: 20 January 2008 11:00 PM   [ Ignore ]   [ # 2 ]
Jr. Member
RankRank
Total Posts:  37
Joined  2007-04-26

Here are the details for anyone interested. Please note that I did not write this code, I only worked on the specs and implementation into Freeform and front-end development, so I probably won’t be able to answer any in-depth questions.

This does the credit card transaction after the page validation.

This extension uses a freeform hook to grab data from Freeform, send it to EWAY and process the result.  It stores most of the post variables in a session variable, and masks part of the CC number before passing it along to the database.

There are three files:

1. /system/extensions/ext.eway.php - The main extension for Eway. This creates an eway object and pulls in xml data functions from:

2. /system/extensions/eway/eway-payment.php - This is a helper library for accessing the EWAY Gateway.

3. /system/extensions/ext.ccpreprocessed.php uses a hook, to stop the CC number from being entered into the DB.
This enables us to have the full details of the users data entered into the DB before being sent onto E-Way. Then after the data has been stored in the DB the ext.eway.php code does the E-WAY transaction and updates the DB directly with the result.

To have a form use the extension it must have a hidden field with use_eway2_ext in it, and post the following fields ‘first_name’, ‘last_name’, ‘email’,’state’, ‘os_state’, ‘address1’,’address2’,’country’,’postcode,’trans_id’,’cardholder_name’,’credit_card_number’,’expiry_month’,’expiry_year’,’dollar_amount’.

Most of those fields are required by eway.

A session variable called “EWAY” is set with a value of OK if the transaction was successful, and an error message if it was not successful.

To make the transactions go live set the $use_live_server variable to true in this file. /system/extensions/eway/eway-payment.php

We chose to have the cc number obscured, so the entries in the DB look like this: ######XXXXXXX### (where # is a number and X is an obscured number).

PLEASE NOTE: This will probably only work with these patches.

Also, to make the form action https instead of http, you will need to use one of these methods.

File Attachments
eway.tgz  (File Size: 5KB - Downloads: 93)
Profile