Class Gateway
Dummy Gateway
This gateway is useful for testing. It simply authorizes any payment made using a valid credit card number and expiry.
Any card number which passes the Luhn algorithm and ends in an even number is authorized, for example: 4242424242424242
Any card number which passes the Luhn algorithm and ends in an odd number is declined, for example: 4111111111111111
Example
// Create a gateway for the Dummy Gateway // (routes to GatewayFactory::create) $gateway = Omnipay::create('Dummy'); // Initialise the gateway $gateway->initialize(array( 'testMode' => true, // Doesn't really matter what you use here. )); // Create a credit card object // This card can be used for testing. $card = new CreditCard(array( 'firstName' => 'Example', 'lastName' => 'Customer', 'number' => '4242424242424242', 'expiryMonth' => '01', 'expiryYear' => '2020', 'cvv' => '123', )); // Do a purchase transaction on the gateway $transaction = $gateway->purchase(array( 'amount' => '10.00', 'currency' => 'AUD', '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\AbstractGateway implements Omnipay\Common\GatewayInterface
- Omnipay\Dummy\Gateway
public
|
|
public
array
|
|
public
|
|
public
|
authorize(),
capture(),
completeAuthorize(),
completePurchase(),
createCard(),
deleteCard(),
purchase(),
refund(),
updateCard(),
void()
|
$httpClient,
$httpRequest,
$parameters
|