Skip to content

Commit 6a24df3

Browse files
committed
Merge remote-tracking branch 'upstream/master' into eway-direct
2 parents 75053ac + 031236c commit 6a24df3

18 files changed

+261
-93
lines changed

.travis.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,10 @@ php:
44
- 5.3
55
- 5.4
66
- 5.5
7-
8-
env:
9-
- SYMFONY_VERSION="2.1" GUZZLE_VERSION="3.1"
10-
- SYMFONY_VERSION="2.*" GUZZLE_VERSION="3.1"
11-
- SYMFONY_VERSION="2.1" GUZZLE_VERSION="3.*"
12-
- SYMFONY_VERSION="2.*" GUZZLE_VERSION="3.*"
7+
- 5.6
8+
- hhvm
139

1410
before_script:
15-
- composer self-update
16-
- composer --version
17-
- composer require symfony/http-foundation:${SYMFONY_VERSION} --no-update
18-
- composer require guzzle/http:${GUZZLE_VERSION} --no-update
1911
- composer install -n --dev --prefer-source
2012

2113
script: vendor/bin/phpcs --standard=PSR2 src && vendor/bin/phpunit --coverage-text

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
**eWay driver for the Omnipay PHP payment processing library**
44

5-
[![Build Status](https://travis-ci.org/omnipay/eway.png?branch=master)](https://travis-ci.org/omnipay/eway)
5+
[![Build Status](https://travis-ci.org/thephpleague/omnipay-eway.png?branch=master)](https://travis-ci.org/thephpleague/omnipay-eway)
66
[![Latest Stable Version](https://poser.pugx.org/omnipay/eway/version.png)](https://packagist.org/packages/omnipay/eway)
77
[![Total Downloads](https://poser.pugx.org/omnipay/eway/d/total.png)](https://packagist.org/packages/omnipay/eway)
88

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

1212
## Installation
@@ -33,7 +33,7 @@ The following gateways are provided by this package:
3333

3434
* Eway_Rapid
3535

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

3939
## Support
@@ -46,5 +46,5 @@ If you want to keep up to date with release anouncements, discuss ideas for the
4646
or ask more detailed questions, there is also a [mailing list](https://groups.google.com/forum/#!forum/omnipay) which
4747
you can subscribe to.
4848

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

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"pay",
1111
"payment"
1212
],
13-
"homepage": "https://github.com/omnipay/eway",
13+
"homepage": "https://github.com/thephpleague/omnipay-eway",
1414
"license": "MIT",
1515
"authors": [
1616
{
@@ -19,11 +19,11 @@
1919
},
2020
{
2121
"name": "Omnipay Contributors",
22-
"homepage": "https://github.com/omnipay/eway/contributors"
22+
"homepage": "https://github.com/thephpleague/omnipay-eway/contributors"
2323
}
2424
],
2525
"autoload": {
26-
"psr-0": { "Omnipay\\Eway\\" : "src/" }
26+
"psr-4": { "Omnipay\\Eway\\" : "src/" }
2727
},
2828
"require": {
2929
"omnipay/common": "~2.0"

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<phpunit backupGlobals="false"
33
backupStaticAttributes="false"
4-
bootstrap="tests/bootstrap.php"
4+
bootstrap="vendor/autoload.php"
55
colors="true"
66
convertErrorsToExceptions="true"
77
convertNoticesToExceptions="true"

src/Omnipay/Eway/Message/RapidPurchaseRequest.php renamed to src/Message/RapidPurchaseRequest.php

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,19 @@ public function getData()
4949
$data['Payment']['CurrencyCode'] = $this->getCurrency();
5050

5151
$data['Customer'] = array();
52-
if ($this->getCard()) {
53-
$data['Customer']['FirstName'] = $this->getCard()->getFirstName();
54-
$data['Customer']['LastName'] = $this->getCard()->getLastName();
52+
$card = $this->getCard();
53+
if ($card) {
54+
$data['Customer']['FirstName'] = $card->getFirstName();
55+
$data['Customer']['LastName'] = $card->getLastName();
56+
$data['Customer']['CompanyName'] = $card->getCompany();
57+
$data['Customer']['Street1'] = $card->getAddress1();
58+
$data['Customer']['Street2'] = $card->getAddress2();
59+
$data['Customer']['City'] = $card->getCity();
60+
$data['Customer']['State'] = $card->getState();
61+
$data['Customer']['PostalCode'] = $card->getPostCode();
62+
$data['Customer']['Country'] = strtolower($card->getCountry());
63+
$data['Customer']['Email'] = $card->getEmail();
64+
$data['Customer']['Phone'] = $card->getPhone();
5565
}
5666

5767
return $data;

src/Message/RapidResponse.php

Lines changed: 209 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,209 @@
1+
<?php
2+
3+
namespace Omnipay\Eway\Message;
4+
5+
use Omnipay\Common\Message\AbstractResponse;
6+
use Omnipay\Common\Message\RedirectResponseInterface;
7+
8+
/**
9+
* eWAY Rapid 3.0 Purchase Response
10+
*/
11+
class RapidResponse extends AbstractResponse implements RedirectResponseInterface
12+
{
13+
public static $MESSAGES = array(
14+
'A2000' => 'Transaction Approved',
15+
'A2008' => 'Honour With Identification',
16+
'A2010' => 'Approved For Partial Amount',
17+
'A2011' => 'Approved, VIP',
18+
'A2016' => 'Approved, Update Track 3',
19+
'D4401' => 'Refer to Issuer',
20+
'D4402' => 'Refer to Issuer, special',
21+
'D4403' => 'No Merchant',
22+
'D4404' => 'Pick Up Card',
23+
'D4405' => 'Do Not Honour',
24+
'D4406' => 'Error',
25+
'D4407' => 'Pick Up Card, Special',
26+
'D4409' => 'Request In Progress',
27+
'D4412' => 'Invalid Transaction',
28+
'D4413' => 'Invalid Amount',
29+
'D4414' => 'Invalid Card Number',
30+
'D4415' => 'No Issuer',
31+
'D4419' => 'Re-enter Last Transaction',
32+
'D4421' => 'No Action Taken',
33+
'D4422' => 'Suspected Malfunction',
34+
'D4423' => 'Unacceptable Transaction Fee',
35+
'D4425' => 'Unable to Locate Record On File',
36+
'D4430' => 'Format Error',
37+
'D4431' => 'Bank Not Supported By Switch',
38+
'D4433' => 'Expired Card, Capture',
39+
'D4434' => 'Suspected Fraud, Retain Card',
40+
'D4435' => 'Card Acceptor, Contact Acquirer, Retain Card',
41+
'D4436' => 'Restricted Card, Retain Card',
42+
'D4437' => 'Contact Acquirer Security Department, Retain Card',
43+
'D4438' => 'PIN Tries Exceeded, Capture',
44+
'D4439' => 'No Credit Account',
45+
'D4440' => 'Function Not Supported',
46+
'D4441' => 'Lost Card',
47+
'D4442' => 'No Universal Account',
48+
'D4443' => 'Stolen Card',
49+
'D4444' => 'No Investment Account',
50+
'D4451' => 'Insufficient Funds',
51+
'D4452' => 'No Cheque Account',
52+
'D4453' => 'No Savings Account',
53+
'D4454' => 'Expired Card',
54+
'D4455' => 'Incorrect PIN',
55+
'D4456' => 'No Card Record',
56+
'D4457' => 'Function Not Permitted to Cardholder',
57+
'D4458' => 'Function Not Permitted to Terminal',
58+
'D4459' => 'Suspected Fraud',
59+
'D4460' => 'Acceptor Contact Acquirer',
60+
'D4461' => 'Exceeds Withdrawal Limit',
61+
'D4462' => 'Restricted Card',
62+
'D4463' => 'Security Violation',
63+
'D4464' => 'Original Amount Incorrect',
64+
'D4466' => 'Acceptor Contact Acquirer, Security',
65+
'D4467' => 'Capture Card',
66+
'D4475' => 'PIN Tries Exceeded',
67+
'D4482' => 'CVV Validation Error',
68+
'D4490' => 'Cut off In Progress',
69+
'D4491' => 'Card Issuer Unavailable',
70+
'D4492' => 'Unable To Route Transaction',
71+
'D4493' => 'Cannot Complete, Violation Of The Law',
72+
'D4494' => 'Duplicate Transaction',
73+
'D4496' => 'System Error',
74+
'S5000' => 'System Error',
75+
'S5085' => 'Started 3dSecure',
76+
'S5086' => 'Routed 3dSecure',
77+
'S5087' => 'Completed 3dSecure',
78+
'S5099' => 'Incomplete (Access Code in progress/incomplete)',
79+
'V6000' => 'Validation error',
80+
'V6001' => 'Invalid CustomerIP',
81+
'V6002' => 'Invalid DeviceID',
82+
'V6011' => 'Invalid Payment TotalAmount',
83+
'V6012' => 'Invalid Payment InvoiceDescription',
84+
'V6013' => 'Invalid Payment InvoiceNumber',
85+
'V6014' => 'Invalid Payment InvoiceReference',
86+
'V6015' => 'Invalid Payment CurrencyCode',
87+
'V6016' => 'Payment Required',
88+
'V6017' => 'Payment CurrencyCode Required',
89+
'V6018' => 'Unknown Payment CurrencyCode',
90+
'V6021' => 'EWAY_CARDNAME Required',
91+
'V6022' => 'EWAY_CARDNUMBER Required',
92+
'V6023' => 'EWAY_CARDCVN Required',
93+
'V6033' => 'Invalid Expiry Date',
94+
'V6034' => 'Invalid Issue Number',
95+
'V6035' => 'Invalid Valid From Date',
96+
'V6040' => 'Invalid TokenCustomerID',
97+
'V6041' => 'Customer Required',
98+
'V6042' => 'Customer FirstName Required',
99+
'V6043' => 'Customer LastName Required',
100+
'V6044' => 'Customer CountryCode Required',
101+
'V6045' => 'Customer Title Required',
102+
'V6046' => 'TokenCustomerID Required',
103+
'V6047' => 'RedirectURL Required',
104+
'V6051' => 'Invalid Customer FirstName',
105+
'V6052' => 'Invalid Customer LastName',
106+
'V6053' => 'Invalid Customer CountryCode',
107+
'V6058' => 'Invalid Customer Title',
108+
'V6059' => 'Invalid RedirectURL',
109+
'V6060' => 'Invalid TokenCustomerID',
110+
'V6061' => 'Invalid Customer Reference',
111+
'V6062' => 'Invalid Customer CompanyName',
112+
'V6063' => 'Invalid Customer JobDescription',
113+
'V6064' => 'Invalid Customer Street1',
114+
'V6065' => 'Invalid Customer Street2',
115+
'V6066' => 'Invalid Customer City',
116+
'V6067' => 'Invalid Customer State',
117+
'V6068' => 'Invalid Customer PostalCode',
118+
'V6069' => 'Invalid Customer Email',
119+
'V6070' => 'Invalid Customer Phone',
120+
'V6071' => 'Invalid Customer Mobile',
121+
'V6072' => 'Invalid Customer Comments',
122+
'V6073' => 'Invalid Customer Fax',
123+
'V6074' => 'Invalid Customer URL',
124+
'V6075' => 'Invalid ShippingAddress FirstName',
125+
'V6076' => 'Invalid ShippingAddress LastName',
126+
'V6077' => 'Invalid ShippingAddress Street1',
127+
'V6078' => 'Invalid ShippingAddress Street2',
128+
'V6079' => 'Invalid ShippingAddress City',
129+
'V6080' => 'Invalid ShippingAddress State',
130+
'V6081' => 'Invalid ShippingAddress PostalCode',
131+
'V6082' => 'Invalid ShippingAddress Email',
132+
'V6083' => 'Invalid ShippingAddress Phone',
133+
'V6084' => 'Invalid ShippingAddress Country',
134+
'V6085' => 'Invalid ShippingAddress ShippingMethod',
135+
'V6086' => 'Invalid ShippingAddress Fax',
136+
'V6091' => 'Unknown Customer CountryCode',
137+
'V6092' => 'Unknown ShippingAddress CountryCode',
138+
'V6100' => 'Invalid EWAY_CARDNAME',
139+
'V6101' => 'Invalid EWAY_CARDEXPIRYMONTH',
140+
'V6102' => 'Invalid EWAY_CARDEXPIRYYEAR',
141+
'V6103' => 'Invalid EWAY_CARDSTARTMONTH',
142+
'V6104' => 'Invalid EWAY_CARDSTARTYEAR',
143+
'V6105' => 'Invalid EWAY_CARDISSUENUMBER',
144+
'V6106' => 'Invalid EWAY_CARDCVN',
145+
'V6107' => 'Invalid EWAY_ACCESSCODE',
146+
'V6108' => 'Invalid CustomerHostAddress',
147+
'V6109' => 'Invalid UserAgent',
148+
'V6110' => 'Invalid EWAY_CARDNUMBER',
149+
);
150+
151+
public function isSuccessful()
152+
{
153+
return isset($this->data['TransactionStatus']) && $this->data['TransactionStatus'];
154+
}
155+
156+
public function isRedirect()
157+
{
158+
return isset($this->data['FormActionURL']);
159+
}
160+
161+
public function getRedirectUrl()
162+
{
163+
return isset($this->data['FormActionURL']) ? $this->data['FormActionURL'] : null;
164+
}
165+
166+
public function getRedirectMethod()
167+
{
168+
return 'POST';
169+
}
170+
171+
public function getRedirectData()
172+
{
173+
if ($this->isRedirect()) {
174+
return array(
175+
'EWAY_ACCESSCODE' => $this->data['AccessCode'],
176+
);
177+
}
178+
}
179+
180+
public function getTransactionReference()
181+
{
182+
return isset($this->data['TransactionID']) ? (string) $this->data['TransactionID'] : null;
183+
}
184+
185+
public function getMessage()
186+
{
187+
$codes = explode(',', $this->getCode());
188+
$messages = array();
189+
190+
foreach ($codes as $code) {
191+
if (isset(static::$MESSAGES[$code])) {
192+
$messages[] = static::$MESSAGES[$code];
193+
} else {
194+
$messages[] = $code;
195+
}
196+
}
197+
198+
return implode(', ', $messages) ?: null;
199+
}
200+
201+
public function getCode()
202+
{
203+
if (!empty($this->data['ResponseMessage'])) {
204+
return $this->data['ResponseMessage'];
205+
} elseif (!empty($this->data['Errors'])) {
206+
return $this->data['Errors'];
207+
}
208+
}
209+
}

src/Omnipay/Eway/Message/RapidResponse.php

Lines changed: 0 additions & 60 deletions
This file was deleted.

src/Omnipay/Eway/RapidGateway.php renamed to src/RapidGateway.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
*/
1010
class RapidGateway extends AbstractGateway
1111
{
12+
public $transparentRedirect = true;
13+
1214
public function getName()
1315
{
1416
return 'eWAY Rapid 3.0';

0 commit comments

Comments
 (0)