jundelleb/laravel-usaepay

A PHP library that allows you to connect to USAePay gateway and run transactions with less configurations needed.

Downloads

3926

Stars

3

Version

v2.1.1

Laravel - USAePay

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

Install using composer:

composer require jundelleb/laravel-usaepay

Add the service provider in app/config/app.php:

PhpUsaepay\ServiceProvider::class,

Configuration

Now publish the configuration files to config/usaepay.php:

$ php artisan vendor:publish

This package supports configuration through the services configuration file located in config/usaepay.php:

Usage

Basic Usage of USAePay:

<?php

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

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

Example

This package takes care of the creation of ueSecurityToken.

Find CustNum using searchCustomerID method

<?php

$custID = '21021';

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

Reference: https://wiki.usaepay.com/developer/soap-1.6/methods/searchcustomerid

Run sale using runTransaction method

<?php

$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);

Reference: https://wiki.usaepay.com/developer/soap-1.6/methods/runtransaction

Refer to this link for the complete lists of methods: http://wiki.usaepay.com/developer/soap-1.6/Support#methods

jundelleb

Author

jundelleb