2017 © Pedro Peláez
 

library firstdata

FirstData API Wrapper

image

loganhenson/firstdata

FirstData API Wrapper

  • Monday, February 29, 2016
  • by loganhenson
  • Repository
  • 1 Watchers
  • 2 Stars
  • 38 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

No Longer Maintained

Build Status, (*1)

Code Climate, (*2)

First Data API v14

Install

composer require loganhenson/firstdata

Info/API

Transaction API Reference, (*3)

Search API Reference, (*4)

Transaction List, (*5)

Demo Transaction List, (*6)

Requires .env file (see .env.example), (*7)

Purchase

<?php

$Transaction = new Transaction(getenv('fd_gateway_id'), getenv('fd_gateway_password'), getenv('fd_key_id'), getenv('fd_key'));
try{
    $response = $Transaction->Purchase('Mastercard', 'Logan Henson', 5500000000000004, 1216, 123, 120);
}catch(FirstDataException $e){
    echo $e->getMessage();
}

Pre Authenticate

<?php

$Transaction = new Transaction(getenv('fd_gateway_id'), getenv('fd_gateway_password'), getenv('fd_key_id'), getenv('fd_key'));
try{
    $response = $Transaction->PreAuth('Mastercard', 'Logan Henson', 5500000000000004, 123, 1216);
    // store the $response['transarmor_token']
}catch(FirstDataException $e){
    echo $e->getMessage();
}

Late Purchase (requires transarmor_token from pre authentication)

<?php

// get the transarmor_token from data storage

$Transaction = new Transaction(getenv('fd_gateway_id'), getenv('fd_gateway_password'), getenv('fd_key_id'), getenv('fd_key'));
try{
    $latePurchaseResponse = $Transaction->LatePurchase('Mastercard', 'Logan Henson', $response['transarmor_token'], 1216, 123, 120);
}catch(FirstDataException $e){
    echo $e->getMessage();
}

## Refund ```php <?php $Transaction = new Transaction(getenv('fd_gateway_id'), getenv('fd_gateway_password'), getenv('fd_key_id'), getenv('fd_key')); try{ $response = $Transaction->Refund('Mastercard', 'Logan Henson', $transarmor_token, 1216, 123, 120); }catch(FirstDataException $e){ echo $e->getMessage(); }

Changing Currency Type

Can be used before Purchase and LatePurchase, (*8)

'EUR', 'GBP', 'CHF', 'CZK', 'DKK', 'JPY', 'ZAR', 'SEK', 'CAD', (*9)

<?php

$Transaction = new Transaction(getenv('fd_gateway_id'), getenv('fd_gateway_password'), getenv('fd_key_id'), getenv('fd_key'));
try{
    $Transaction->setCurrency('CAD');
    $response = $Transaction->Purchase('Mastercard', 'Logan Henson', 5500000000000004, 1216, 123, 120);
}catch(FirstDataException $e){
    echo $e->getMessage();
}

Get All Transactions


$Search = new Search(getenv('fd_username'), getenv('fd_password')); try{ $transactions = $Search->getTransactions(); }catch(FirstDataException $e){ echo $e->getMessage(); }

Test Data

Visa 4111111111111111
Expiry Date: Any future date., (*10)

Mastercard 5500000000000004
Expiry Date: Any future date., (*11)

American Express 340000000000009 Note: Amex is 15 characters
Expiry Date: Any future date., (*12)

JCB 3566002020140006
Expiry Date: Any future date., (*13)

Discover 6011000000000004
Expiry Date: Any future date., (*14)

Diners Club 36438999960016
Expiry Date: Any future date.om, (*15)

The Versions

29/02 2016

dev-master

9999999-dev

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

06/05 2015

v2.0.0

2.0.0.0

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

05/05 2015

v1.0.4

1.0.4.0

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

31/03 2015

v1.0.3

1.0.3.0

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

26/03 2015

v1.0.2

1.0.2.0

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

03/01 2015

v1.0.0

1.0.0.0

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires

03/01 2015

v1.0.1

1.0.1.0

FirstData API Wrapper

  Sources   Download

MIT

The Requires

 

The Development Requires