shela/omnipay-nmi

NMI (Network Merchants Inc.) driver for the Omnipay PHP payment processing library

3.07 2020-01-15 17:55 UTC

This package is auto-updated.

Last update: 2024-03-27 23:56:33 UTC


README

NMI (Network Merchants Inc.) driver for the Omnipay PHP payment processing library

Omnipay is a framework agnostic, multi-gateway payment processing library for PHP 5.3+. This package implements NMI (Network Merchants Inc.) support for Omnipay.

Installation

Omnipay is installed via Composer. To install, simply require morcano/omnipay-nmi with Composer:

composer require morcano/omnipay-nmi:"*"

Basic Usage

The following gateways are provided by this package:

  • NMI_DirectPost
$gateway = Omnipay::create('NMI_DirectPost');
$gateway->setUsername('demo');
$gateway->setPassword('password');

$request = $gateway->purchase([
    'amount' => $amount,
    'card' => [
        'number' => '4111111111111111',
        'expiryMonth' => '10',
        'expiryYear' => '25',
        'cvv' => '111'
    ],
    ...
])->send();

if ($response->isSuccessful()) {
    // payment was successful: update database
    dump($response);
} else {
    // payment failed: display message to customer
    dump('Error: ' . $response->getMessage());
}

Support

If you are having general issues with Omnipay, we suggest posting on Stack Overflow. Be sure to add the omnipay tag so it can be easily found.

If you want to keep up to date with release anouncements, discuss ideas for the project, or ask more detailed questions, there is also a mailing list which you can subscribe to.

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.