jundelleb / laravel-usaepay by jundelleb

A PHP library that allows you to connect to USAePay gateway and run transactions with less configurations needed.
3,937
3
2
Package Data
Maintainer Username: jundelleb
Maintainer Contact: bondetni@gmail.com (Jundelle Boyles)
Package Create Date: 2016-02-19
Package Last Update: 2021-08-20
Language: PHP
License: MIT
Last Refreshed: 2024-04-29 15:04:42
Package Statistics
Total Downloads: 3,937
Monthly Downloads: 11
Daily Downloads: 0
Total Stars: 3
Total Watchers: 2
Total Forks: 4
Total Open Issues: 3

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