Ejemplo n.º 1
0
<?php

// USA ePay PHP Library.
//      v1.6
//
//      Copyright (c) 2002-2008 USA ePay
//      For support please contact devsupport@usaepay.com
//
//  The following is an example of running a transaction using the php library.
//  Please see the README file for more information on usage.
//
// Change this path to the location you have save usaepay.php to
include "./src/umTransaction.php";
// Instantiate USAePay client object
$tran = new USAePay\umTransaction();
// Merchants Source key must be generated within the console
$tran->key = "897asdfjha98ds6f76324hbmnBZc9769374ybndfs876";
// Send request to sandbox server not production.  Make sure to comment or remove this line before
//  putting your code into production
$tran->usesandbox = true;
$tran->card = "4005562233445564";
$tran->exp = "0312";
$tran->amount = "1.00";
$tran->invoice = "1234";
$tran->cardholder = "Test T Jones";
$tran->street = "1234 Main Street";
$tran->zip = "90036";
$tran->description = "Online Order";
$tran->cvv2 = "435";
echo "<h1>Please Wait One Moment While We process your card.<br>\n";
flush();
Ejemplo n.º 2
0
// USA ePay PHP Library.
//      v1.6
//
//      Copyright (c) 2002-2008 USA ePay
//      For support please contact devsupport@usaepay.com
//
//  The following is an example of running a quicksale, which is a new transaction
//  against a prior sale or credit.  Credit card (or ACH) data is retrieved from
//  prior transaction and does not need to be provided.  The only required information
//  is the transaction reference number (refnum) and the amount.
//
//  Please see the README file for more information on usage.
//
// Change this path to the location you have save usaepay.php to
include "./src/umTransaction.php";
$tran = new USAePay\umTransaction();
$tran->key = "897asdfjha98ds6f76324hbmnBZc9769374ybndfs876";
$tran->usesandbox = true;
$tran->pin = "1234";
$tran->ip = $REMOTE_ADDR;
// This allows fraud blocking on the customers ip address
$tran->testmode = 0;
// Change this to 0 for the transaction to process
$tran->usesandbox = 1;
$tran->amount = "10.00";
// charge amount in dollars
$tran->invoice = "1234";
// invoice number.  must be unique.
$tran->description = "Online Order";
// description of charge
$tran->refnum = "47100443";