CHARGE A CUSTOMER

This code steps you through the process of charging a customer’s credit card.

There are three outcomes when processing credit card transactions:

Approved
Declined
Error

‘Approved’ transactions can be charged against customers’ credit cards. ‘Declined’ transactions can’t be charged. As a result, in order to test the process of charging a customer’s credit card, you must first pass an odd dollar amount. This returns the transaction with an ‘Approved’ status. You can then charge the credit card to complete the transaction.

An error could result from a variety of conditions such as missing data, invalid card numbers, and expiration dates provided in invalid formats.

The following sample code calls a routine from our Code Library.
DownloadPay2Amigos.php
Or, download via GitHub

Run a Credit Card Payment

<?php
/**
* Pay2Amigos PHP Sample Code
*
* This code sample runs a $3.00 Credit Card Sale transaction
* against a customer using test payment information.
* If using TEST mode, odd dollar amounts will return
* an approval and even dollar amounts will return a decline.
*
*/
include('../pay2amigos.php');
$accountID = "Merchant's Account ID Here";
$secretKey = "Merchant's Secret Key Here";
$mode = "TEST";
 
$payment = new Pay2Amigos
Can’t find what you’re
looking for? We can help.

Contact 855-422-9385 for Integration Support.

compress_logo-cred-ms-gold-01a
logo-cred-komen-01a
footer-steve2018-award
cnp-2018-rev
footer-tsg2018-award
compress_pillar_2017