Skip to content

Add NMI processor #89

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions Metadata/omnipay_NMI_Direct.mgd.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<?php
/**
* Declaration for NMI processor.
*
* - name - omnipay_{Processor_Name}, Omnipay calls the gateway method create with the processor name as the parameter.
* To get the processor name take a look at the Readme for the gateway you are adding - you will generally see
* The following gateways are provided by this package: Mollie so the name should be ominpay_Mollie (note matching capitalisation)
*
* A more complex example is omnipay_SecurePay_DirectPayment.
* This breaks down as
* - omnipay_ - our label within CiviCRM to denote Omnipay
* - SecurePay - the namespace as declared within the composer.json within the securepay gateway
* - DirectPost - the prefix on the Gateway file. It is called DirectPostGateway.php - this portion is excluded when the file is simply
* named 'Gateway.php'
*
* - user_name_label, password_label, signature_label, subject_label - these are generally about telling the plugin what to call these when they pass them to
* Omnipay. They are also shown to users so some reformatting is done to turn it into lower-first-letter camel case. Take a look at the gateway file for your gateway. This is directly under src.
* Some provide more than one and the 'getName' function distinguishes them. The getDefaultParameters will tell you what to pass. eg if you see
* 'apiKey' you should enter 'user_name' => 'Api Key' (you might ? be able to get away with 'API Key' - need to check). You can provide as many or as
* few as you want of these and it's irrelevant which field you put them in but note that the signature field is the longest and that
* in future versions of CiviCRM hashing may be done on password and signature on the screen.
*
* - 'class_name' => 'Payment_OmnipayMultiProcessor', (always)
*
* - 'url_site_default' - this is ignored. But, by giving one you make it easier for people adding processors
*
* - 'billing_mode' - 1 = onsite, 4 = redirect offsite (including transparent redirects).
*
* - payment_mode - 1 = credit card, 2 = debit card, 3 = transparent redirect. In practice 3 means that billing details are gathered on-site so
* it may also be used with automatic redirects where address fields need to be mandatory for the signature.
*
* The record will be automatically inserted, updated, or deleted from the
* database as appropriate. For more details, see "hook_civicrm_managed" at:
* http://wiki.civicrm.org/confluence/display/CRMDOC/Hook+Reference
*/
return [
[
'name' => 'OmniPay - NMI_DirectPost"',
'entity' => 'payment_processor_type',
'params' => [
'version' => 3,
'title' => 'OmniPay - NMI',
'name' => 'omnipay_NMI_DirectPost',
'user_name_label' => 'username',
'password_label' => 'password',
'description' => 'NMI (Network Merchants Inc.) driver for the Omnipay PHP payment processing library',
'class_name' => 'Payment_OmnipayMultiProcessor',
'billing_mode' => 1,
],
],
];
7 changes: 6 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
{
"type": "git",
"url": "https://github.com/eileenmcnaughton/omnipay-paypal.git"
},
{
"type": "git",
"url": "https://github.com/nerdmedia/omnipay-nmi.git"
}

],
Expand All @@ -31,7 +35,8 @@
"omnipay/common": "^3.0@dev",
"dioscouri/omnipay-cybersource": "^3.0@dev",
"fuzion/omnipay-mercanet": "^3.0@dev",
"razorpay/omnipay-razorpay": "^3.0@dev"
"razorpay/omnipay-razorpay": "^3.0@dev",
"nerdmedia/omnipay-nmi": "^3.0@dev"
},
"require-dev": {
"phpunit/phpunit": "5.7",
Expand Down
50 changes: 49 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vendor/composer/autoload_psr4.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
'Omnipay\\Razorpay\\' => array($vendorDir . '/razorpay/omnipay-razorpay/src'),
'Omnipay\\PaymentExpress\\' => array($vendorDir . '/omnipay/paymentexpress/src'),
'Omnipay\\PayPal\\' => array($vendorDir . '/omnipay/paypal/src'),
'Omnipay\\NMI\\' => array($vendorDir . '/nerdmedia/omnipay-nmi/src'),
'Omnipay\\NABTransact\\' => array($vendorDir . '/sudiptpa/omnipay-nabtransact/src'),
'Omnipay\\Mollie\\' => array($vendorDir . '/omnipay/mollie/src'),
'Omnipay\\Mercanet\\' => array($vendorDir . '/fuzion/omnipay-mercanet/src'),
Expand Down
5 changes: 5 additions & 0 deletions vendor/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ class ComposerStaticInit7c7bccbe7d16fd96ad45f827acd06a81
'Omnipay\\Razorpay\\' => 17,
'Omnipay\\PaymentExpress\\' => 23,
'Omnipay\\PayPal\\' => 15,
'Omnipay\\NMI\\' => 12,
'Omnipay\\NABTransact\\' => 20,
'Omnipay\\Mollie\\' => 15,
'Omnipay\\Mercanet\\' => 17,
Expand Down Expand Up @@ -165,6 +166,10 @@ class ComposerStaticInit7c7bccbe7d16fd96ad45f827acd06a81
array (
0 => __DIR__ . '/..' . '/omnipay/paypal/src',
),
'Omnipay\\NMI\\' =>
array (
0 => __DIR__ . '/..' . '/nerdmedia/omnipay-nmi/src',
),
'Omnipay\\NABTransact\\' =>
array (
0 => __DIR__ . '/..' . '/sudiptpa/omnipay-nabtransact/src',
Expand Down
49 changes: 49 additions & 0 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,55 @@
"object graph"
]
},
{
"name": "nerdmedia/omnipay-nmi",
"version": "3.04",
"version_normalized": "3.04.0.0",
"source": {
"type": "git",
"url": "https://github.com/nerdmedia/omnipay-nmi.git",
"reference": "0d8ae95698b586fbd35b69bee5230853007d6aa7"
},
"require": {
"league/omnipay": "^3"
},
"time": "2018-12-05T20:04:47+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
},
"installation-source": "source",
"autoload": {
"psr-4": {
"Omnipay\\NMI\\": "src/"
}
},
"license": [
"MIT"
],
"authors": [
{
"name": "Steve Bazemore",
"email": "[email protected]"
}
],
"description": "NMI (Network Merchants Inc.) driver for the Omnipay PHP payment processing library",
"homepage": "https://github.com/nerdmedia/omnipay-nmi",
"keywords": [
"durango",
"gateway",
"inc",
"merchant",
"network",
"nmi",
"omnipay",
"pay",
"payment",
"purchase"
]
},
{
"name": "omnipay/authorizenet",
"version": "3.2.0",
Expand Down
5 changes: 5 additions & 0 deletions vendor/nerdmedia/omnipay-nmi/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/vendor
composer.lock
composer.phar
phpunit.xml
.idea
21 changes: 21 additions & 0 deletions vendor/nerdmedia/omnipay-nmi/.travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
language: php

php:
- 5.3
- 5.4
- 5.5

env:
- SYMFONY_VERSION="2.1" GUZZLE_VERSION="3.1"
- SYMFONY_VERSION="2.*" GUZZLE_VERSION="3.1"
- SYMFONY_VERSION="2.1" GUZZLE_VERSION="3.*"
- SYMFONY_VERSION="2.*" GUZZLE_VERSION="3.*"

before_script:
- composer self-update
- composer --version
- composer require symfony/http-foundation:${SYMFONY_VERSION} --no-update
- composer require guzzle/http:${GUZZLE_VERSION} --no-update
- composer install -n --dev --prefer-source

script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text
10 changes: 10 additions & 0 deletions vendor/nerdmedia/omnipay-nmi/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Contributing Guidelines

* Fork the project.
* Make your feature addition or bug fix.
* Add tests for it. This is important so I don't break it in a future version unintentionally.
* Commit just the modifications, do not mess with the composer.json or CHANGELOG.md files.
* Ensure your code is nicely formatted in the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)
style and that all tests pass.
* Send the pull request.
* Check that the Travis CI build passed. If not, rinse and repeat.
22 changes: 22 additions & 0 deletions vendor/nerdmedia/omnipay-nmi/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
The MIT License (MIT)

Copyright (c) 2015 Matthieu Fauveau

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
58 changes: 58 additions & 0 deletions vendor/nerdmedia/omnipay-nmi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Omnipay: NMI (Network Merchants Inc.)

**NMI (Network Merchants Inc.) 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 [NMI](https://www.nmi.com/) (Network Merchants Inc.) support for Omnipay.

## Installation

Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply require `nerdmedia/omnipay-nmi` with Composer:

```
composer require nerdmedia/omnipay-nmi:"3.x@dev"
```

## Basic Usage

The following gateways are provided by this package:

* NMI_DirectPost

```php
$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](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 anouncements, 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/thephpleague/omnipay-authorizenet/issues),
or better yet, fork the library and submit a pull request.
36 changes: 36 additions & 0 deletions vendor/nerdmedia/omnipay-nmi/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "nerdmedia/omnipay-nmi",
"type": "library",
"description": "NMI (Network Merchants Inc.) driver for the Omnipay PHP payment processing library",
"keywords": [
"gateway",
"merchant",
"omnipay",
"pay",
"payment",
"purchase",
"nmi",
"durango",
"network",
"inc"
],
"homepage": "https://github.com/nerdmedia/omnipay-nmi",
"license": "MIT",
"authors": [
{
"name": "Steve Bazemore",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": { "Omnipay\\NMI\\" : "src/" }
},
"require": {
"league/omnipay": "^3"
},
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
}
}
Loading