Skip to content

Commit 1287a3f

Browse files
committed
Merge remote-tracking branch 'origin/master'
Conflicts: src/AIMGateway.php src/Message/AIMRefundRequest.php src/SIMGateway.php tests/Message/AIMRefundRequestTest.php tests/Mock/AIMRefundFailure.txt tests/Mock/AIMRefundSuccess.txt
2 parents d4ff08b + 7b51669 commit 1287a3f

File tree

7 files changed

+39
-14
lines changed

7 files changed

+39
-14
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ php:
44
- 5.3
55
- 5.4
66
- 5.5
7+
- 5.6
78
- hhvm
89

910
matrix:

README.md

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

33
**Authorize.Net driver for the Omnipay PHP payment processing library**
44

5-
[![Build Status](https://travis-ci.org/omnipay/authorizenet.png?branch=master)](https://travis-ci.org/omnipay/authorizenet)
5+
[![Build Status](https://travis-ci.org/thephpleague/omnipay-authorizenet.png?branch=master)](https://travis-ci.org/thephpleague/omnipay-authorizenet)
66
[![Latest Stable Version](https://poser.pugx.org/omnipay/authorizenet/version.png)](https://packagist.org/packages/omnipay/authorizenet)
77
[![Total Downloads](https://poser.pugx.org/omnipay/authorizenet/d/total.png)](https://packagist.org/packages/omnipay/authorizenet)
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 Authorize.Net support for Omnipay.
1111

1212
## Installation
@@ -35,7 +35,7 @@ The following gateways are provided by this package:
3535
* AuthorizeNet_CIM
3636
* AuthorizeNet_SIM
3737

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

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

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

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"pay",
1313
"payment"
1414
],
15-
"homepage": "https://github.com/omnipay/authorizenet",
15+
"homepage": "https://github.com/thephpleague/omnipay-authorizenet",
1616
"license": "MIT",
1717
"authors": [
1818
{
@@ -21,7 +21,7 @@
2121
},
2222
{
2323
"name": "Omnipay Contributors",
24-
"homepage": "https://github.com/omnipay/authorizenet/contributors"
24+
"homepage": "https://github.com/thephpleague/omnipay-authorizenet/contributors"
2525
}
2626
],
2727
"autoload": {

src/AIMGateway.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ public function getName()
2222
public function getDefaultParameters()
2323
{
2424
return array(
25-
'apiLoginId' => '',
25+
'apiLoginId' => '',
2626
'transactionKey' => '',
27-
'testMode' => false,
28-
'developerMode' => false,
27+
'testMode' => false,
28+
'developerMode' => false,
2929
);
3030
}
3131

src/SIMGateway.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public function capture(array $parameters = array())
8282

8383
public function purchase(array $parameters = array())
8484
{
85-
return $this->createRequest('\Omnipay\AuthorizeNet\Message\SIMAuthorizeRequest', $parameters);
85+
return $this->createRequest('\Omnipay\AuthorizeNet\Message\SIMPurchaseRequest', $parameters);
8686
}
8787

8888
public function completePurchase(array $parameters = array())

tests/Message/AIMRefundRequestTest.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ class AIMRefundRequestTest extends TestCase
1313
public function setUp()
1414
{
1515
$this->request = new AIMRefundRequest($this->getHttpClient(), $this->getHttpRequest());
16-
}
17-
18-
public function testGetDataMissingCardInfo()
19-
{
2016
$this->request->initialize(
2117
array(
2218
'transactionReference' => '123',

tests/Message/AIMResponseTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,4 +97,32 @@ public function testPurchaseFailure()
9797
$this->assertSame('', $response->getAuthorizationCode());
9898
$this->assertSame('P', $response->getAVSCode());
9999
}
100+
101+
public function testRefundSuccess()
102+
{
103+
$httpResponse = $this->getMockHttpResponse('AIMRefundSuccess.txt');
104+
105+
$response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody());
106+
107+
$this->assertTrue($response->isSuccessful());
108+
$this->assertSame('2217770693', $response->getTransactionReference());
109+
$this->assertSame('This transaction has been approved.', $response->getMessage());
110+
$this->assertSame(1, $response->getResultCode());
111+
$this->assertSame(1, $response->getReasonCode());
112+
$this->assertSame('P', $response->getAVSCode());
113+
}
114+
115+
public function testRefundFailure()
116+
{
117+
$httpResponse = $this->getMockHttpResponse('AIMRefundFailure.txt');
118+
$response = new AIMResponse($this->getMockRequest(), $httpResponse->getBody());
119+
120+
$this->assertFalse($response->isSuccessful());
121+
$this->assertSame('0', $response->getTransactionReference());
122+
$this->assertSame('The referenced transaction does not meet the criteria for issuing a credit.', $response->getMessage());
123+
$this->assertSame(3, $response->getResultCode());
124+
$this->assertSame(54, $response->getReasonCode());
125+
$this->assertSame('', $response->getAuthorizationCode());
126+
$this->assertSame('P', $response->getAVSCode());
127+
}
100128
}

0 commit comments

Comments
 (0)