Skip to content

Commit f88da07

Browse files
authored
Merge pull request #24 from sudiptpa/upgrading-v3
Support new v3 of Omnipay
2 parents 587f07a + 142114c commit f88da07

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+344
-2518
lines changed

.travis.yml

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,27 @@
11
language: php
22

33
php:
4-
- '5.3'
5-
- '5.4'
6-
- '5.5'
7-
- '5.6'
8-
- '7.0'
9-
- '7.1'
4+
- 5.6
5+
- 7.0
6+
- 7.1
7+
- 7.2
108

11-
before_script:
12-
- composer install -n --dev --prefer-source
9+
env:
10+
global:
11+
- setup=basic
1312

14-
script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text
13+
matrix:
14+
include:
15+
- php: 5.6
16+
env: setup=lowest
17+
18+
sudo: false
19+
20+
before_install:
21+
- travis_retry composer self-update
22+
23+
install:
24+
- if [[ $setup = 'basic' ]]; then travis_retry composer install --no-interaction --prefer-dist; fi
25+
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable; fi
26+
27+
script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2016
3+
Copyright (c) 2016-2018 Sujip Thapa
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
**NAB Transact driver for the Omnipay PHP payment processing library**
44

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

88
[![StyleCI](https://styleci.io/repos/74269379/shield?style=flat&branch=master)](https://styleci.io/repos/74269379)
99
[![Build Status](https://travis-ci.org/sudiptpa/omnipay-nabtransact.svg?branch=master&style=flat-square)](https://travis-ci.org/sudiptpa/omnipay-nabtransact)
@@ -13,26 +13,20 @@ processing library for PHP 5.3+. This package implements NAB Transact support fo
1313

1414
## Installation
1515

16-
Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply add it
17-
to your `composer.json` file:
16+
Omnipay is installed via [Composer](http://getcomposer.org/). To install, simply require `league/omnipay` and `sudiptpa/omnipay-nabtransact` with Composer:
1817

19-
```json
20-
{
21-
"require": {
22-
"sudiptpa/omnipay-nabtransact": "~2.0"
23-
}
24-
}
2518
```
26-
27-
And run composer to update your dependencies:
28-
29-
$ curl -s http://getcomposer.org/installer | php
30-
$ php composer.phar update
19+
composer require league/omnipay sudiptpa/omnipay-nabtransact
20+
```
3121

3222
## Basic Usage
3323

3424
The following gateways are provided by this package:
3525

26+
* NABTransact_DirectPost (NAB Transact Direct Post v2)
27+
* NABTransact_SecureXML (NAB Transact SecurePay XML)
28+
* NABTransact_UnionPay (UnionPay via NAB Transact)
29+
3630
### NAB Transact SecureXML API
3731

3832
```php
@@ -43,27 +37,27 @@ The following gateways are provided by this package:
4337
$gateway->setMerchantId('XYZ0010');
4438
$gateway->setTransactionPassword('abcd1234');
4539
$gateway->setTestMode(true);
46-
40+
4741
$card = new CreditCard([
4842
'firstName' => 'Sujip',
49-
'lastName' => 'Thapa',
43+
'lastName' => 'Thapa',
5044
'number' => '4444333322221111',
5145
'expiryMonth' => '06',
5246
'expiryYear' => '2030',
5347
'cvv' => '123',
5448
]
5549
);
56-
50+
5751
$transaction = $gateway->purchase([
5852
'amount' => '10.00',
5953
'currency' => 'AUD',
6054
'transactionId' => 'XYZ100',
6155
'card' => $card,
6256
]
6357
);
64-
58+
6559
$response = $transaction->send();
66-
60+
6761
if ($response->isSuccessful()) {
6862
echo sprintf('Transaction %s was successful!', $response->getTransactionReference());
6963
} else {

composer.json

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
{
2-
"name": "sudiptpa/omnipay-nabtransact",
3-
"type": "library",
4-
"description": "NAB Transact driver for the Omnipay payment processing library",
5-
"keywords": [
6-
"gateway",
7-
"merchant",
8-
"omnipay",
9-
"pay",
10-
"payment",
11-
"nabtransact"
12-
],
13-
"homepage": "https://github.com/sudiptpa/nabtransact",
14-
"license": "MIT",
15-
"authors": [
16-
{
17-
"name": "Sujip Thapa",
18-
"email": "sudiptpa@gmail.com"
19-
}
20-
],
21-
"autoload": {
22-
"psr-4": {
23-
"Omnipay\\NABTransact\\" : "src/"
24-
}
25-
},
26-
"require": {
27-
"cweagans/composer-patches": "~1.6",
28-
"omnipay/common": "~2.3"
29-
},
30-
"require-dev": {
31-
"omnipay/tests": "~2.0",
32-
"satooshi/php-coveralls": "1.0.0",
33-
"fzaninotto/faker": "~1.4"
34-
},
35-
"extra": {
36-
"branch-alias": {
37-
"dev-master": "2.0.x-dev"
38-
},
39-
"patches": {
40-
"guzzle/guzzle": {
41-
"Update CA": "patches/guzzle-guzzle-update-cacert.patch"
42-
}
43-
}
44-
}
45-
}
2+
"name":"sudiptpa/omnipay-nabtransact",
3+
"type":"library",
4+
"description":"National Australia Bank (NAB) Transact driver for the Omnipay payment processing library.",
5+
"keywords":[
6+
"gateway",
7+
"merchant",
8+
"omnipay",
9+
"pay",
10+
"payment",
11+
"nabtransact"
12+
],
13+
"homepage":"https://github.com/sudiptpa/nabtransact",
14+
"license":"MIT",
15+
"authors":[
16+
{
17+
"name":"Sujip Thapa",
18+
"email":"sudiptpa@gmail.com"
19+
}
20+
],
21+
"autoload":{
22+
"psr-4":{
23+
"Omnipay\\NABTransact\\":"src/"
24+
}
25+
},
26+
"require":{
27+
"omnipay/common":"^3"
28+
},
29+
"require-dev":{
30+
"omnipay/tests":"^3",
31+
"squizlabs/php_codesniffer":"^3",
32+
"phpro/grumphp":"^0.14.0"
33+
},
34+
"extra":{
35+
"branch-alias":{
36+
"dev-master":"3.0.x-dev"
37+
}
38+
},
39+
"scripts":{
40+
"test":"vendor/bin/phpunit",
41+
"check-style":"phpcs -p --standard=PSR2 src/",
42+
"fix-style":"phpcbf -p --standard=PSR2 src/"
43+
},
44+
"prefer-stable":true
45+
}

grumphp.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
parameters:
2+
git_dir: .
3+
bin_dir: vendor/bin
4+
tasks:
5+
phpunit:
6+
config_file: ~
7+
testsuite: ~
8+
group: []
9+
always_execute: false
10+
phpcs:
11+
standard: PSR2
12+
warning_severity: ~
13+
ignore_patterns:
14+
- tests/
15+
triggered_by: [php]

index.php

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,21 @@
1212

1313
$gateway->setTestMode(true);
1414

15-
$card = new CreditCard(array(
15+
$card = new CreditCard([
1616
'firstName' => 'Sujip',
1717
'lastName' => 'Thapa',
1818
'number' => '4444333322221111',
19-
'expiryMonth' => '10',
20-
'expiryYear' => '2030',
19+
'expiryMonth' => '12',
20+
'expiryYear' => date('Y'),
2121
'cvv' => '123',
22-
));
22+
]);
2323

24-
$response = $gateway->purchase(array(
24+
$response = $gateway->purchase([
2525
'amount' => '12.00',
26-
'transactionId' => 'ORDER-ZYX8',
26+
'transactionId' => 'ORDER-ZYX8789',
2727
'currency' => 'AUD',
2828
'card' => $card,
29-
))
30-
->send();
29+
])->send();
3130

3231
$message = sprintf(
3332
'Transaction with reference code (%s) - %s',

0 commit comments

Comments
 (0)