PHPackages                             visualr/omnipay-tillpayments - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Payment Processing](/categories/payments)
4. /
5. visualr/omnipay-tillpayments

ActiveLibrary[Payment Processing](/categories/payments)

visualr/omnipay-tillpayments
============================

Till Payments driver for the Omnipay payment processing library

v2.1.1(4y ago)11.5k4[1 PRs](https://github.com/teamvisualr/omnipay-tillpayments/pulls)MITPHP

Since May 7Pushed 3y agoCompare

[ Source](https://github.com/teamvisualr/omnipay-tillpayments)[ Packagist](https://packagist.org/packages/visualr/omnipay-tillpayments)[ Docs](https://github.com/teamvisualr/omnipay-tillpayments)[ RSS](/packages/visualr-omnipay-tillpayments/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)Dependencies (2)Versions (6)Used By (0)

Omnipay: Till Payments
======================

[](#omnipay-till-payments)

**Till Payments driver for the Omnipay PHP payment processing library**

[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements eWAY support for Omnipay.

[Till Payments](https://tillpayments.com/) was founded in 2012 with the primary focus of helping technology vendors and their customers streamline their payments acceptance and operations.

Installation
------------

[](#installation)

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it to your `composer.json` file:

```
{
    "require": {
        "visualr/omnipay-tillpayments": "~2.0"
    }
}
```

And run composer to update your dependencies:

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

```

Basic Usage
-----------

[](#basic-usage)

For general usage instructions, please see the main [Omnipay](https://github.com/thephpleague/omnipay)repository.

### Initializing Gateway

[](#initializing-gateway)

```
// Create a gateway
$gateway = Omnipay::create('TillPayments');

// Initialise the gateway
$gateway->initialize(array(
    'apiKey' => 'your-api-key',
    'secretKey' => 'your-secret-key',
    'username' => 'your-username',
    'password' => 'your-password',
    'testMode'  => TRUE, // or FALSE when you are ready for live transactions
    'defaultMerchantTransactionIdPrefix'  => 'omnipay-', // prefix of the merchantTransactionId (optional)
));
```

**Remember!** You will have different **API Key** for different connectors

### Purchase Transaction

[](#purchase-transaction)

This is called **Debit** on Till Documentation

```
try {
    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->purchase([
        'amount' => '10.00', // this represents $10.00
        'currency' => 'AUD',
        'card' => $card,
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency codeYou can also pass `transactionToken` on the payload if you receive a token using Till Payment's `payment.js`

For more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-debit)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Authorize Transaction

[](#authorize-transaction)

This is called **Preauthorize** on Till Documentation

A Preauthorize reserves the payment amount on the customer's payment instrument.

Depending on the payment method you have up to 7 days until you must Capture the transaction before the authorization expires.

```
try {
    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->authorize([
        'amount' => '10.00', // this represents $10.00
        'currency' => 'AUD',
        'card' => $card,
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency codeYou can also pass `transactionToken` on the payload if you receive a token using Till Payment's `payment.js`

For more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-preauthorize)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Capture Transaction

[](#capture-transaction)

A Capture completes the payment which was previously authorized with the Preauthorize method.

Depending on the payment method you can even capture only a partial amount of the authorized amount.

```
try {
    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->capture([
        'amount' => '10.00', // this represents $10.00
        'currency' => 'AUD',
        'card' => $card,
        'referenceUuid' => 'bcdef23456bcdef23456', // UUID / transaction reference of a preauthorize
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency code`referenceUuid`UUID / transaction reference of a preauthorizeFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-capture)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Purchase Transaction

[](#purchase-transaction-1)

This is called **Debit** on Till Documentation

```
try {
    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->purchase([
        'amount' => '10.00', // this represents $10.00
        'currency' => 'AUD',
        'card' => $card,
        'returnUrl' => 'https://www.example.com/return', // optional
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency codeFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-debit)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Authorize Transaction

[](#authorize-transaction-1)

This is called **Preauthorize** on Till Documentation

A Preauthorize reserves the payment amount on the customer's payment instrument.

Depending on the payment method you have up to 7 days until you must Capture the transaction before the authorization expires.

```
try {
    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->authorize([
        'amount' => '10.00', // this represents $10.00
        'currency' => 'AUD',
        'card' => $card,
        'returnUrl' => 'https://www.example.com/return', // optional
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency codeFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-preauthorize)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Capture Transaction

[](#capture-transaction-1)

A Capture completes the payment which was previously authorized with the Preauthorize method.

Depending on the payment method you can even capture only a partial amount of the authorized amount.

```
try {

    $request = $gateway->capture([
        'amount' => '10.00', // this represents $10.00
        'currency' => 'AUD',
        'referenceUuid' => 'bcdef23456bcdef23456', // UUID / transaction reference of a preauthorize
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency code`referenceUuid`UUID / transaction reference of a preauthorizeFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-capture)

### Void Transaction

[](#void-transaction)

A Void cancels a previously performed authorization made with the Preauthorize method.

```
try {

    $request = $gateway->void([
        'referenceUuid' => 'bcdef23456bcdef23456', // UUID / transaction reference of a preauthorize
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`referenceUuid`UUID / transaction reference of a preauthorizeFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-void)

### Create Card Transaction

[](#create-card-transaction)

This is called **Register** on Till Documentation

Registers a customer's payment instrument for future charges (Debits or Preauthorizations)

```
try {

    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->createCard([
        'card' => $card,
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be usedFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-capture)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Delete Card Transaction

[](#delete-card-transaction)

This is called **Deregister** on Till Documentation

A Deregister deletes a previously registered payment instrument using Register.

```
try {

    // You need to define your own $formData array
    $card = new CreditCard($formData);

    $request = $gateway->deleteCard([
        'referenceUuid' => 'ccf0ddd790db9d7ef41b',
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`referenceUuid`UUID of a register, debit-with-register or preauthorize-with-registerFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-capture)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Refund Transaction

[](#refund-transaction)

A Refund reverses a payment which was previously performed with Debit or Capture.

Depending on the payment method you can even refund only a partial amount of the original transaction amou

```
try {

    $request = $gateway->refund([
        'amount'                => '1.25',
        'currency'              => 'AUD',
        'referenceUuid'         => '48bbd15cdf9e5b81985d',
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here
        // Use $response->getTransactionReference() to get transaction uuid

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Required FieldsNotes`merchantTransactionId`Your unique transaction ID. If left blank, default one will be used`amount`Decimals separated by ., max. 3 decimals`currency`3 letter currency code`referenceUuid`UUID of a register, debit-with-register or preauthorize-with-registerFor more information about the payload, refer to: [Till Payment Documentation](https://gateway.tillpayments.com/documentation/apiv3#transaction-request-capture)

For more information about the card data, refer to: [Omnipay Credit Card Documentation](https://github.com/thephpleague/omnipay/tree/v2.3.1#credit-card--payment-form-input)

### Payout Transaction

[](#payout-transaction)

Coming soon

### Incremental Authorization

[](#incremental-authorization)

Coming soon

The Payment Responses
---------------------

[](#the-payment-responses)

### Successful Response

[](#successful-response)

For a successful responses, a reference will normally be generated, which can be used to capture or refund the transaction at a later date. The following methods are always available:

```
$response = $gateway->purchase([
    'amount' => '10.00',
    'currency' => 'AUD',
    'card' => $card
])->send();

$response->isSuccessful(); // is the response successful?
$response->isRedirect(); // is the response a redirect?
$response->getTransactionReference(); // a transaction uuid generated by the payment gateway
$response->getMessage(); // a message generated by the payment gateway
```

If you are going to implement refund and void, you will need to always save the transaction reference since it is often used as `referenceUuid`.

### Redirect Response

[](#redirect-response)

After processing a payment, the cart should check whether the response requires a redirect, and if so, redirect accordingly:

```
$response = $gateway->purchase([
    'amount' => '10.00',
    'currency' => 'AUD',
    'card' => $card
])->send();

if ($response->isSuccessful()) {
    // payment is complete
} elseif ($response->isRedirect()) {
    $response->redirect(); // this will automatically forward the customer
} else {
    // not successful
}
```

The customer isn't automatically forwarded on, because often the cart or developer will want to customize the redirect method (or if payment processing is happening inside an AJAX call they will want to return JS to the browser instead).

To display your own redirect page, simply call `getRedirectUrl()` on the response, then display it accordingly:

```
$url = $response->getRedirectUrl();
```

### Error Response

[](#error-response)

You can test for a successful response by calling `isSuccessful()` on the response object. If there was an error communicating with the gateway, or your request was obviously invalid, an exception will be thrown. In general, if the gateway does not throw an exception, but returns an unsuccessful response, it is a message you should display to the customer. If an exception is thrown, it is either a bug in your code (missing required fields), or a communication error with the gateway.

The simplest way is to wrap the entire request in a try-catch block.

```
try {

    $request = $gateway->refund([
        'amount'                => '1.25',
        'currency'              => 'AUD',
        'referenceUuid'         => '48bbd15cdf9e5b81985d',
    ]);

    $response = $transaction->send();

    if ($response->isSuccessful()) {

        // Do stuff here like marking order as complete

    } else {

        // Handle errors

    }

} catch (\Guzzle\Http\Exception\ClientErrorResponseException $e) {

    // Handle Exception Errors (use $e->getResponse()->getBody() to get JSON data)

} catch (\Exception $e) {

    // Handle Exception Errors (use $e->getMessage() to get data)

}
```

Advanced Usage
--------------

[](#advanced-usage)

### Using Customer instead of CreditCard

[](#using-customer-instead-of-creditcard)

Coming soon

### Schedule

[](#schedule)

Coming soon

### Accepting Notification

[](#accepting-notification)

Coming soon

Support
-------

[](#support)

If you are having general issues with Omnipay, we suggest posting on [Stack Overflow](http://stackoverflow.com/). Be sure to add the [omnipay tag](http://stackoverflow.com/questions/tagged/omnipay) so it can be easily found.

If you want to keep up to date with release announcements, discuss ideas for the project, or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which you can subscribe to.

If you believe you have found a bug, please report it using the [GitHub issue tracker](https://github.com/teamvisualr/omnipay-tillpayments/issues), or better yet, fork the library and submit a pull request.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~66 days

Total

4

Last Release

1632d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/adc77911e7553f18fcf974ada6667fc4f15e9e6020adbc5b77f5013e1db23b8b?d=identicon)[teamvisualr](/maintainers/teamvisualr)

---

Top Contributors

[![kamranViusalr](https://avatars.githubusercontent.com/u/88645870?v=4)](https://github.com/kamranViusalr "kamranViusalr (3 commits)")[![syanaputra](https://avatars.githubusercontent.com/u/5687937?v=4)](https://github.com/syanaputra "syanaputra (1 commits)")

---

Tags

paymentgatewaypaymerchantomnipaytill

### Embed Badge

![Health badge](/badges/visualr-omnipay-tillpayments/health.svg)

```
[![Health](https://phpackages.com/badges/visualr-omnipay-tillpayments/health.svg)](https://phpackages.com/packages/visualr-omnipay-tillpayments)
```

###  Alternatives

[lokielse/omnipay-alipay

Alipay gateway for Omnipay payment processing library

587421.0k11](/packages/lokielse-omnipay-alipay)[sudiptpa/omnipay-nabtransact

National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.

1017.2k](/packages/sudiptpa-omnipay-nabtransact)[lucassmacedo/omnipay-mercadopago

MercadoPago gateway for OmniPay

154.6k](/packages/lucassmacedo-omnipay-mercadopago)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
