Class FatzebraGateway
Fat Zebra / Paystream Gateway
Example
// Create a gateway for the Fat Zebra REST Gateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('Fatzebra_Fatzebra'); // Initialise the gateway $gateway->initialize(array( 'username' => 'TEST', 'token' => 'TEST', 'testMode' => true, // Or false when you are ready for live transactions )); // Create a credit card object // This card can be used for testing. $card = new CreditCard(array( 'firstName' => 'Example', 'lastName' => 'Customer', 'number' => '4005550000000001', 'expiryMonth' => '01', 'expiryYear' => '2020', 'cvv' => '123', )); // Do a purchase transaction on the gateway $transaction = $gateway->purchase(array( 'amount' => '10.00', 'transactionId' => 'TestPurchaseTransaction123456', 'clientIp' => $_SERVER['REMOTE_ADDR'], 'card' => $card, )); $response = $transaction->send(); if ($response->isSuccessful()) { echo "Purchase transaction was successful!\n"; $sale_id = $response->getTransactionReference(); echo "Transaction reference = " . $sale_id . "\n"; }
Test modes
There are two test modes in the Paystream system - one is a sandbox environment and the other is a test mode flag.
The Sandbox Environment is an identical copy of the live environment which is 100% functional except for communicating with the banks.
The Test Mode Flag is used to switch the live environment into test mode. If test: true is sent with your request your transactions will be executed in the live environment, but not communicate with the bank backends. This mode is useful for testing changes to your live website.
Currently this class makes the assumption that if the testMode flag is set then the Sandbox Environment is being used.
Authentication
Authentication is by means of a username / token pair. For each username / token there will also be a "shared secret" which is not used by this gateway, but is instead used by the Direct Post gateway (see https://docs.fatzebra.com.au/direct).
Developers can get in touch with Fat Zebra (see the contact page at https://www.fatzebra.com.au/contact) directly to get their own test account details. There is however generic test account details available within the API Documentation. Please see these details below.
- username: TEST
- token: TEST
- Shared Secret: 033bd94b11
Quirks
- All payments are in Australian Dollars (AUD). No other currency is supported.
- A unique transactionId must be provided for each transaction.
- Voids are not supported, only refunds are supported.
- I do not know all of the error codes, except for 05 (declined) and 99 (bad/missing data). They do not appear in the API documentation anywhere.
TODO
- Fatzebra_Paystream gateway can be implemented using the same code but a different set of endpoints.
- Support a Fatzebra_DirectPost gateway for redirect based payments.
- Omnipay\Common\AbstractGateway implements Omnipay\Common\GatewayInterface
- Omnipay\Fatzebra\FatzebraGateway
See:
Omnipay\Common\AbstractGateway
See:
Omnipay\Fatzebra\Message\AbstractRestRequest
Link: http://www.paystream.com.au/developer-guides/
Link: https://www.fatzebra.com.au/
Located at FatzebraGateway.php
public
string
|
|
public
array
|
|
public
string
|
|
public
|
|
public
string
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
|
public
|
authorize(),
capture(),
completeAuthorize(),
completePurchase(),
createCard(),
deleteCard(),
purchase(),
refund(),
updateCard(),
void()
|
string |
FREQUENCY_WEEKLY
|
#
'Weekly'
|
string |
FREQUENCY_MONTHLY
|
#
'Monthly'
|
$httpClient,
$httpRequest,
$parameters
|