dev-master
9999999-devFirstData API Wrapper
MIT
The Requires
The Development Requires
by Logan Henson
FirstData API Wrapper
composer require loganhenson/firstdata
Transaction API Reference, (*3)
Search API Reference, (*4)
Transaction List, (*5)
Demo Transaction List, (*6)
Requires .env file (see .env.example), (*7)
<?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(); }
<?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(); }
<?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(); }
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(); }
$Search = new Search(getenv('fd_username'), getenv('fd_password')); try{ $transactions = $Search->getTransactions(); }catch(FirstDataException $e){ echo $e->getMessage(); }
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)
FirstData API Wrapper
MIT