PHP code example of jundelleb / laravel-usaepay

1. Go to this page and download the library: Download jundelleb/laravel-usaepay library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jundelleb / laravel-usaepay example snippets




$sourcekey = 'your_source_key';
$sourcepin = 'your_source_pin';
$sandbox = true;
$options = [
    'debug' => true,
];

$usaepay = new \PhpUsaepay\Client($sourcekey, $sourcepin, $sandbox, $options);




$custID = '21021';

$custNum = $usaepay->searchCustomerID($custID);




$request = [
    'Command' => 'sale',
    'AccountHolder' => 'John Doe',
    'Details' => [
      'Description' => 'Example Transaction',
      'Amount' => '4.00',
      'Invoice' => '44539'
    ],
    'CreditCardData' => [
      'CardNumber' => '4444555566667779',
      'CardExpiration' => '0919',
      'AvsStreet' => '1234 Main Street',
      'AvsZip' => '99281',
      'CardCode' => '999'
    ]
];

$result = $usaepay->runTransaction($request);