/guzzle-eway

A Guzzle client for the Eway Direct Transactions API

Primary LanguagePHPMIT LicenseMIT

guzzle-eway

Build Status

A PHP 5.3+ Guzzle client for interacting with the Eway Direct Transaction API.

Installation

Add this to your composer.json by running composer.phar require bluedogtraining/guzzle-eway.

Usage

Create API client

$client = \Bdt\Eway\EwayClient::factory();

Send Payment

Command arguments are as defined in the Eway API, except without the eway prefix.

$response = $client->getCommand('SendPayment', array(
    'customerID'      => '87654321',                                   
    'totalAmount'     => '10',                                         
    'cardHoldersName' => 'Foo Bar',                                    
    'cardNumber'      => '4444333322221111',                           
    'cardExpiryMonth' => '06',                                         
    'cardExpiryYear'  => '20',                                         
    'CVN'             => '123',
))->execute();

$response['trxnStatus']; // true
$response['trxnError']['code']; // 10

Running Tests

First, install PHPUnit with composer.phar install --dev, then run ./vendor/bin/phpunit.

More Reading