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
    • VivaPayments
      • Message
  • PHP

Classes

  • AuthorizeRequest
  • Response
  • Overview
  • Namespace
  • Class
  • Tree

Class AuthorizeRequest

Dummy Authorize Request

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 an authorize transaction on the gateway
$transaction = $gateway->authorize(array(
    'amount'                   => '10.00',
    'currency'                 => 'AUD',
    'card'                     => $card,
));
$response = $transaction->send();
if ($response->isSuccessful()) {
    echo "Authorize transaction was successful!\n";
    $sale_id = $response->getTransactionReference();
    echo "Transaction reference = " . $sale_id . "\n";
}
Omnipay\Common\Message\AbstractRequest implements Omnipay\Common\Message\RequestInterface
Extended by Omnipay\Dummy\Message\AuthorizeRequest
Namespace: Omnipay\Dummy\Message
Located at Message/AuthorizeRequest.php
Methods summary
public mixed
# getData( )

Get the raw data array for this message. The format of this varies from gateway to gateway, but will usually be either an associative array, or a SimpleXMLElement.

Get the raw data array for this message. The format of this varies from gateway to gateway, but will usually be either an associative array, or a SimpleXMLElement.

Returns

mixed
public ResponseInterface
# sendData( mixed $data )

Send the request with specified data

Send the request with specified data

Parameters

$data
The data to send

Returns

ResponseInterface
Methods inherited from Omnipay\Common\Message\AbstractRequest
__construct(), formatCurrency(), getAmount(), getAmountInteger(), getCancelUrl(), getCard(), getCardReference(), getClientIp(), getCurrency(), getCurrencyDecimalPlaces(), getCurrencyNumeric(), getDescription(), getIssuer(), getItems(), getNotifyUrl(), getParameter(), getParameters(), getPaymentMethod(), getResponse(), getReturnUrl(), getTestMode(), getToken(), getTransactionId(), getTransactionReference(), initialize(), send(), setAmount(), setCancelUrl(), setCard(), setCardReference(), setClientIp(), setCurrency(), setDescription(), setIssuer(), setItems(), setNotifyUrl(), setParameter(), setPaymentMethod(), setReturnUrl(), setTestMode(), setToken(), setTransactionId(), setTransactionReference(), toFloat(), validate()
Properties inherited from Omnipay\Common\Message\AbstractRequest
$httpClient, $httpRequest, $negativeAmountAllowed, $parameters, $response, $zeroAmountAllowed
Omnipay Viva Payments Gateway Module API Documentation API documentation generated by ApiGen