jundelleb/laravel-usaepay

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

v2.1.1 2021-08-20 13:09 UTC

This package is auto-updated.

Last update: 2024-11-20 20:02:11 UTC


README

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