General GSPAY HTML integration scheme.
1. HTML form request should be generated on the Merchant’s site
checkout page. This HTML form should has all necessary fields i.e.
orderID, orderAmount, orderDescription, customerFullName and so on.
Action of this form shold point to
https://secure.checkout2pay.com/payment/pay.php, and parameter returnUrl
should point back to your site, on a page which will process order in
your database an show status message to customer. Ypu may use pair of
ApproveURL/DeclineURL variables if your need different return pages for
paaroved and declined transactions.
You may use form generation wizard ( click "Prices" link on
"My sites" block in the Merchant Control Panel).
Example
2. Customer click "submit" button on this form and goes to the GSPAY site.
After transaction was processed in bank, customer will be redirected back on your
site, to the URL which was entered into returnURL field. Some
additional parameters indicates order progress will be submitted
to this URL by GET method. One of them is transactionTransactionID.
It contains uniquie number of transaction in GSPAY database.
Others are: transactionTransactionID, transactionStatus,customerOrderID,transactionAmount
3. When customer returned on returnURL, you should check status of transaction to avoid fraud
attempts. Prepare XML request like this
transactionStatusTR123456789
You should change transactionTransactionID in XML request to number
which was submitten to returnURL page from GSPAY.
Submit XML to https://secure.checkout2pay.com/payment/api.php and you’ll
get XML response with information for this transaction.
Example of such test may be found at
http://www.gspay.com/docs/checkstatus_example.phps
Detailed description located at http://www.gspay.com/docs/API_Integration.pdf
Example of status response message:
approved1
Some description
TR123456789
sale
approved82.19
APPR
WWW.GSPAY.COM
25Nov2008152022_25
4. If response message says that transaction type is 'sale', and
transaction status is 'successeful' you may sure that this
transaction approved. Mark it as approved in your database and show
'success' page for the customer.
You may perform any additional actions on this stage, i.e.
send mail to the customer, update your order and so on.
5. Callback script
You may setup callback script with your server. This scrip should place on
your server and it will be executed after each transaction. Enter script address
into “Callback script URL" field into Site Preferenes pag of Merchant Control
Panel if you want to use it.
After each Sale, Rebill, Refund, Chargeback we post all transaction parameters
that will allow you to do whatever you want. You may insert transaction data
in your Database or make any changes in your own accounting system. To
configure this, you need to click site "Preferences" and enter in "Callback
script URL" address to your script. You can make this script on any
programming language. Simply parse all parameters we post:
transactionID, transactionType(sale, rebill, refund, chargeback), transactionStatus(approved, declined), action(adduser, deluser, update), transactionAmount, siteID, ProductListing, customerFullName, customerPhone, customerAddress, customerCity, customerZip, customerCountry, customerEmail, customerLogin, customerPassword, customerShippingFullName, customerShippingPhone, customerShippingAddress, customerShippingCity, customerShippingStateCode, customerShippingZip, customerShippingCountryCode, customerShippingEmail, customerShippingCountry, customerIP
6. Test Cards
By using test cards, GSPAY allows you to test out your order form and payment
procedure (Postbacks, membership setup). You are able testing on your site,
even in Live Merchant mode. Enter one of the test card (for Approve or Decline
result) and we will determine that this is a test order and create
Approved/Declined transaction. This purchase is not a real transaction, but
the results of the transaction are real. It will really add a user to your
system, and allow you to see basically what the user will
see after transaction complete. To make a test transaction, click on your
site's purchase button, and when you get to the GSPAY order page, you just
enter any Customer's details, be sure you enter valid email address to receive
Payment notification.
Use following credit card numbers to run test transactions.
4444445555555555 card will simulate a successful transaction
4444446666666666 card will simulate a declined transactio
To perform test transaction, you will need following:
Include the TransactionMode request field with a value of “test” in the
transaction request form.
See the sample below.
Sample for submitting the test order
GSPAY Team.