Skip to content
This repository has been archived by the owner on Apr 1, 2020. It is now read-only.

seymourlabs/omnipay-invoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Omnipay: Invoice

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";
}