Intro to the Payment Gateway with PHP

Skip to end of metadata
Go to start of metadata
Intro to the Payment Gateway with PHP

This is a small guide which describes how to invoke the trident_gateway.inc PHP file found here, as well as in the Payment Gateway Specification.
The intended function and audience of this article is to help existing web developers familiar with PHP quickly integrate the MeS Payment Gateway.

Download the include file here
This PHP include file requires the cURL extension to be installed. Please be sure cURL is configured in your PHP installation before proceeding.

In order to test the functionality of the include file and your PHP installation, use the snip on the left below. Plug in a valid development or production Profile ID and Key, save the page somewhere within your web root. Once you call the script, you should receive an output similar to the right column.

PHP Functionality Test
Output Result

Once you get a positive result from the above test, you can easily build off it.
An approved transaction will always have a "000" error code, therefore you will want to test this to determine the transaction outcome. The class function isApproved() does this for us, so let's build off that.
When sending transactions to our simulator (cert.merchante-solutions.com), the response is based on the request data. See the Payment Gateway Specification for all possible combinations. For now, we will try sending $1 for an approval, and $0.05 for a decline message.

PHP Functionality Test

When run with the amount over $1, the transaction approves.

Output Result: approval

An amount of $0.05 produces a 005 decline message.

Output Result: decline

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.