How To: Credit Card and ACH (e-check) integration in PHP

This is the fourth part in a series of postings on how to integrate credit card and ACH/E-check transactions into various systems. This installment demonstrates code used for processing payments (credit card and/or ACH) within a PHP application.

This was taken from the NELiX TransaX FleXport toolkit documentation. Credit card integration examples can be downloaded on the NELiX TransaX FleXport page.

Assumptions:
- Using NELiX TransaX Payment Gateway
- Communicating using NELiX TransaX Webservice
 ini_set('display_errors', '1');
//load nusoap code
require_once('nusoap.php');
//create client
$soapclient = new nusoap_client('https://www.nelixtransax.com/roxapi/rox.asmx?WSDL','wsdl');
//gather parameters
$params['TransactionType'] = $_POST['TransactionType'];
$params['GatewayUserName'] = $_POST['GatewayUserName'];
$params['GatewayPassword'] = $_POST['GatewayPassword'];
$params['IPAddress'] = $_SERVER['REMOTE_ADDR'];
$params['Merchant_Defined_Field_1'] = $_POST['Merchant_Defined_Field_1'];
$params['Merchant_Defined_Field_2'] = $_POST['Merchant_Defined_Field_2'];
$params['PaymentType'] = $_POST['PaymentType'];
$params['Customer_Vault_ID'] = $_POST['Customer_Vault_ID'];
$params['CCNumber'] = $_POST['CCNumber'];
$params['CCExpDate'] = $_POST['CCExpDate'];
$params['CVV'] = $_POST['CVV'];
$params['Payment_Plan_SKU'] = $_POST['Payment_Plan_SKU'];
$params['Amount'] = $_POST['Amount'];
$params['Tax'] = $_POST['Tax'];
$params['Shipping'] = $_POST['Shipping'];
$params['OrderDescription'] = $_POST['OrderDescription'];
$params['OrderID'] = $_POST['OrderID'];
$params['PONumber'] = $_POST['PONumber'];
$params['FirstName'] = $_POST['FirstName'];
$params['LastName'] = $_POST['LastName'];
$params['Company'] = $_POST['Company'];
$params['Address1'] = $_POST['Address1'];
$params['Address2'] = $_POST['Address2'];
$params['City'] = $_POST['City'];
$params['State'] = $_POST['State'];
$params['Zip'] = $_POST['Zip'];
$params['Country'] = $_POST['Country'];
$params['Phone'] = $_POST['Phone'];
$params['Fax'] = $_POST['Fax'];
$params['EMail'] = $_POST['EMail'];
$params['Website'] = $_POST['Website'];
$params['ShippingFirstName'] = $_POST['ShippingFirstName'];
$params['ShippingLastName'] = $_POST['ShippingLastName'];
$params['ShippingCompany'] = $_POST['ShippingCompany'];
$params['ShippingAddress1'] = $_POST['ShippingAddress1'];
$params['ShippingAddress2'] = $_POST['ShippingAddress2'];
$params['ShippingCity'] = $_POST['ShippingCity'];
$params['ShippingState'] = $_POST['ShippingState'];
$params['ShippingZip'] = $_POST['ShippingZip'];
$params['ShippingCountry'] = $_POST['ShippingCountry'];
$params['ShippingEmail'] = $_POST['ShippingEmail'];
$params['ProcessorID'] = $_POST['ProcessorID'];
$params['Descriptor'] = $_POST['Descriptor'];
$params['DescriptorPhone'] = $_POST['DescriptorPhone'];


$proxy = $soapclient->getProxy();

$result = $proxy->ProcessTransaction(Array('objparameters' => $params));

print_r($result);

?>



If you need any assistance with payment processing integration with your PHP system, we are here to help!

Download PHP credit card and ACH (e-check) integration examples.

Comments

Popular posts from this blog

VB.NET WinForms and payment processing

VB6 / Visual Basic 6 - credit card and ACH procecessing