Overview

Namespaces

  • Guzzle
    • Batch
      • Exception
    • Cache
    • Common
      • Exception
    • Http
      • Curl
      • Exception
      • Message
        • Header
      • QueryAggregator
    • Inflection
    • Iterator
    • Log
    • Parser
      • Cookie
      • Message
      • UriTemplate
      • Url
    • Plugin
      • Async
      • Backoff
      • Cache
      • Cookie
        • CookieJar
        • Exception
      • CurlAuth
      • ErrorResponse
        • Exception
      • History
      • Log
      • Md5
      • Mock
      • Oauth
    • Service
      • Builder
      • Command
        • Factory
        • LocationVisitor
          • Request
          • Response
      • Description
      • Exception
      • Resource
    • Stream
    • Tests
      • Batch
      • Cache
      • Common
        • Cache
        • Exception
      • Http
        • Curl
        • Exception
        • Message
          • Header
      • Inflection
      • Iterator
      • Log
      • Message
      • Mock
      • Parser
        • Cookie
        • Message
      • Parsers
        • UriTemplate
      • Plugin
        • Async
        • Backoff
        • Cache
        • Cookie
          • CookieJar
        • CurlAuth
        • ErrorResponse
        • History
        • Log
        • Md5
        • Mock
        • Oauth
        • Redirect
      • Service
        • Builder
        • Command
          • LocationVisitor
            • Request
            • Response
        • Description
        • Exception
        • Mock
          • Command
            • Sub
          • Model
        • Resource
      • Stream
  • None
  • Omnipay
    • Common
      • Exception
      • Message
    • Dummy
      • Message
    • Fatzebra
      • Message
  • PHP

Classes

  • FatzebraGateway
  • Overview
  • Namespace
  • Class
  • Tree

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
Extended by Omnipay\Fatzebra\FatzebraGateway
Namespace: Omnipay\Fatzebra
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
Methods summary
public string
# getName( )

Get the gateway display name

Get the gateway display name

Returns

string
public array
# getDefaultParameters( )

Get the gateway default parameters

Get the gateway default parameters

Returns

array

Overrides

Omnipay\Common\AbstractGateway::getDefaultParameters()
public string
# getUsername( )

Get the gateway username

Get the gateway username

Returns

string
public Omnipay\Fatzebra\FatzebraGateway
# setUsername( string $value )

Set the gateway username

Set the gateway username

Note that all test usernames begin with the word TEST in upper case.

Parameters

$value

Returns

Omnipay\Fatzebra\FatzebraGateway
provides a fluent interface.
public string
# getToken( )

Get the gateway token -- used as the password in HTTP Basic Auth

Get the gateway token -- used as the password in HTTP Basic Auth

Returns

string
public Omnipay\Fatzebra\FatzebraGateway
# setToken( string $value )

Set the gateway token -- used as the password in HTTP Basic Auth

Set the gateway token -- used as the password in HTTP Basic Auth

Parameters

$value

Returns

Omnipay\Fatzebra\FatzebraGateway
provides a fluent interface.
public Omnipay\Fatzebra\Message\PurchaseRequest
# purchase( array $parameters = array() )

Create a purchase request.

Create a purchase request.

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\PurchaseRequest
public Omnipay\Fatzebra\Message\FetchTransactionRequest
# fetchTransaction( array $parameters = array() )

Fetch a purchase

Fetch a purchase

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\FetchTransactionRequest
public Omnipay\Fatzebra\Message\RefundRequest
# refund( array $parameters = array() )

Refund a purchase

Refund a purchase

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\RefundRequest
public Omnipay\Fatzebra\Message\CreateCardRequest
# createCard( array $parameters = array() )

Tokenize a card

Tokenize a card

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\CreateCardRequest

Link

http://www.paystream.com.au/developer-guides/
public Omnipay\Fatzebra\Message\CreatePlanRequest
# createPlan( array $parameters = array() )

Create a plan

Create a plan

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\CreatePlanRequest

Link

http://www.paystream.com.au/developer-guides/
public Omnipay\Fatzebra\Message\FetchPlanRequest
# fetchPlan( array $parameters = array() )

Fetch details of a plan

Fetch details of a plan

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\FetchPlanRequest
public Omnipay\Fatzebra\Message\FetchAllPlansRequest
# fetchAllPlans( array $parameters = array() )

Fetch all plans

Fetch all plans

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\FetchAllPlansRequest
public Omnipay\Fatzebra\Message\CreateCustomerRequest
# createCustomer( array $parameters = array() )

Create a customer

Create a customer

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\CreateCustomerRequest

Link

http://www.paystream.com.au/developer-guides/
public Omnipay\Fatzebra\Message\FetchCustomerRequest
# fetchCustomer( array $parameters = array() )

Fetch details of a customer

Fetch details of a customer

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\FetchCustomerRequest
public Omnipay\Fatzebra\Message\DeleteCustomerRequest
# deleteCustomer( array $parameters = array() )

Delete a customer

Delete a customer

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\DeleteCustomerRequest
public Omnipay\Fatzebra\Message\CreateSubscriptionRequest
# createSubscription( array $parameters = array() )

Create a subscription

Create a subscription

A subscription is an instance of a customer subscribing to a plan.

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\CreateSubscriptionRequest

Link

http://www.paystream.com.au/developer-guides/
public Omnipay\Fatzebra\Message\FetchSubscriptionRequest
# fetchSubscription( array $parameters = array() )

Fetch details of a subscription

Fetch details of a subscription

Parameters

$parameters

Returns

Omnipay\Fatzebra\Message\FetchSubscriptionRequest
Methods inherited from Omnipay\Common\AbstractGateway
__construct(), createRequest(), getCurrency(), getDefaultHttpClient(), getDefaultHttpRequest(), getParameter(), getParameters(), getShortName(), getTestMode(), initialize(), setCurrency(), setParameter(), setTestMode(), supportsAcceptNotification(), supportsAuthorize(), supportsCapture(), supportsCompleteAuthorize(), supportsCompletePurchase(), supportsCreateCard(), supportsDeleteCard(), supportsPurchase(), supportsRefund(), supportsUpdateCard(), supportsVoid()
Magic methods inherited from Omnipay\Common\GatewayInterface
authorize(), capture(), completeAuthorize(), completePurchase(), createCard(), deleteCard(), purchase(), refund(), updateCard(), void()
Constants summary
string FREQUENCY_WEEKLY
# 'Weekly'
string FREQUENCY_MONTHLY
# 'Monthly'
Properties inherited from Omnipay\Common\AbstractGateway
$httpClient, $httpRequest, $parameters
Omnipay Fat Zebra / Paystream Gateway Module API Documentation API documentation generated by ApiGen