Class PurchaseRequest
Fat Zebra REST Purchase Request
In order to create a purchase you must submit the following details:
- Amount (numerical)
- Reference (string - maximum 30 characters) -- this must be unique. More than one transaction using the same Reference value will raise an error.
- Customer IP (RFC standard IP address)
Either
- Card Holder (string)
- Card Number (string, numerical, 13 to 16 digits)
- Card Expiry (string, mm/yyyy format)
- CVV (numerical, 3 or 4 digits)
Or
- Card Token (String)
Example:
// Create a gateway for the Fat Zebra REST Gateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('FatzebraGateway'); // 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"; }
- Omnipay\Common\Message\AbstractRequest implements Omnipay\Common\Message\RequestInterface
- Omnipay\Fatzebra\Message\AbstractRestRequest
- Omnipay\Fatzebra\Message\PurchaseRequest
Namespace: Omnipay\Fatzebra\Message
See:
Link: http://www.paystream.com.au/developer-guides/
Located at Message/PurchaseRequest.php
See:
Omnipay\Fatzebra\FatzebraGateway
Link: http://www.paystream.com.au/developer-guides/
Located at Message/PurchaseRequest.php
public
mixed
|
|
protected
string
|
getHttpMethod(),
getUsername(),
sendData(),
setUsername()
|
API_VERSION
|
$liveEndpoint,
$testEndpoint
|
$httpClient,
$httpRequest,
$negativeAmountAllowed,
$parameters,
$response,
$zeroAmountAllowed
|