seymourlabs/omnipay-invoice

This package is abandoned and no longer maintained. No replacement package was suggested.

Invoice driver for the Omnipay payment processing library

1.0 2017-06-29 13:22 UTC

This package is not auto-updated.

Last update: 2020-08-17 22:11:42 UTC


README

Generate invoice numbers via the transaction call as a driver for the Omnipay PHP payment processing library

Latest Stable Version Total Downloads

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements Sage Pay support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply add it to your composer.json file:

{
    "require": {
        "seymourlabs/omnipay-invoice": "~1.0"
    }
}

And run composer to update your dependencies:

$ curl -s http://getcomposer.org/installer | php
$ php composer.phar update

Basic Usage

// Create a gateway for the Invoice Gateway
// (routes to GatewayFactory::create)
$gateway = \Omnipay\Omnipay::create('Invoice');

// Initialise the gateway
$gateway->initialize([
    'testMode' => true, // Test mode prepends "TEST:" into the invoice number
]);


// Do an authorize transaction on the gateway
$transaction = $gateway->authorize([
    'amount'                   => '10.00',
    'currency'                 => 'GBP',
]);

// optional prefix assignment
$transaction->setPrefix('ABC');

$response = $transaction->send();
if ($response->isSuccessful()) {
    echo "Authorize transaction was successful!\n";
    $sale_id = $response->getTransactionReference();
    echo "Transaction reference = " . $sale_id . "\n";
}