Skip to content

Commit 69e2526

Browse files
committed
Update to Omnipay 3
1 parent 66381ef commit 69e2526

File tree

8 files changed

+36
-33
lines changed

8 files changed

+36
-33
lines changed

.travis.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@ language: php
22

33
dist: trusty
44
php:
5+
- "7.4"
6+
- "7.3"
57
- "7.2"
68
- "7.1"
79
- "7.0"
810
- "5.6"
9-
- "5.5"
10-
- "5.4"
11-
12-
matrix:
13-
include:
14-
- php: "5.3"
15-
dist: precise
1611

1712
before_script:
18-
- composer install -n --dev --prefer-source
13+
- travis_retry composer self-update
14+
- travis_retry composer install --no-interaction --dev --prefer-source
1915

2016
script:
2117
- vendor/bin/phpcs --standard=PSR2 src

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2019 Leith Caldwell
1+
Copyright (c) 2020 Leith Caldwell
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

README.md

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

1212

1313
[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic, multi-gateway payment
14-
processing library for PHP 5.3+. This package implements CyberSource support for Omnipay. It includes
14+
processing library for PHP 5.6+. This package implements CyberSource support for Omnipay. It includes
1515
support for the Secure Acceptance Hosted Checkout (formerly Web/Mobile) version of the gateway.
1616

1717
## Installation
@@ -22,7 +22,7 @@ to your `composer.json` file:
2222
```json
2323
{
2424
"require": {
25-
"PatronBase/omnipay-cybersource-hosted": "~2.0"
25+
"PatronBase/omnipay-cybersource-hosted": "~3.0"
2626
}
2727
}
2828
```

composer.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,16 @@
3232
"psr-4": { "Omnipay\\CyberSource\\" : "tests/" }
3333
},
3434
"require": {
35-
"omnipay/common": "~2.0"
35+
"omnipay/common": "~3.0"
3636
},
3737
"require-dev": {
38-
"omnipay/tests": "~2.0"
38+
"omnipay/tests": "~3.0",
39+
"squizlabs/php_codesniffer": "^3.5"
3940
},
4041
"extra": {
4142
"branch-alias": {
42-
"dev-master": "2.0.x-dev"
43+
"dev-master": "3.0.x-dev"
4344
}
44-
}
45+
},
46+
"prefer-stable": true
4547
}

phpunit.xml.dist

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@
1717
<directory>./tests/</directory>
1818
</testsuite>
1919
</testsuites>
20-
<listeners>
21-
<listener class="Mockery\Adapter\Phpunit\TestListener" file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php" />
22-
</listeners>
2320
<filter>
2421
<whitelist>
2522
<directory>./src</directory>

src/Message/CompletePurchaseResponse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function __construct(RequestInterface $request, $data)
4444

4545
/**
4646
* Is the response successful?
47-
*
47+
*
4848
* Possible values: 'ACCEPT', 'DECLINE', 'REVIEW', 'ERROR', 'CANCEL'
4949
*
5050
* @return boolean

src/Message/PurchaseResponse.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
namespace Omnipay\CyberSource\Message;
44

55
use Omnipay\Common\Message\AbstractResponse;
6+
use Omnipay\Common\Message\RedirectResponseInterface;
67

78
/**
89
* CyberSource Purchase Response
910
*/
10-
class PurchaseResponse extends AbstractResponse
11+
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
1112
{
1213
public function isSuccessful()
1314
{

tests/Message/CompletePurchaseResponseTest.php

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,25 @@ public function testCompletePurchaseError()
249249
}
250250

251251
/**
252-
* @expectedException Omnipay\Common\Exception\InvalidResponseException
253-
* @expectedExceptionMessage Invalid response from payment gateway (no data)
252+
* @doesNotPerformAssertions
254253
*/
255254
public function testCompletePurchaseInvalidNoParameters()
256255
{
256+
$this->expectException('Omnipay\Common\Exception\InvalidResponseException');
257+
$this->expectExceptionMessage('Invalid response from payment gateway (no data)');
257258
$this->response = new CompletePurchaseResponse(
258259
$this->getMockRequest(),
259260
array()
260261
);
261262
}
262263

263264
/**
264-
* @expectedException Omnipay\Common\Exception\InvalidResponseException
265-
* @expectedExceptionMessage Invalid response from payment gateway (no data)
265+
* @doesNotPerformAssertions
266266
*/
267267
public function testCompletePurchaseInvalidNoDecision()
268268
{
269+
$this->expectException('Omnipay\Common\Exception\InvalidResponseException');
270+
$this->expectExceptionMessage('Invalid response from payment gateway (no data)');
269271
$this->response = new CompletePurchaseResponse(
270272
$this->getMockRequest(),
271273
array(
@@ -276,11 +278,12 @@ public function testCompletePurchaseInvalidNoDecision()
276278
}
277279

278280
/**
279-
* @expectedException Omnipay\Common\Exception\InvalidResponseException
280-
* @expectedExceptionMessage Invalid response from payment gateway (no data)
281+
* @doesNotPerformAssertions
281282
*/
282283
public function testCompletePurchaseInvalidNoSignatureDefinition()
283284
{
285+
$this->expectException('Omnipay\Common\Exception\InvalidResponseException');
286+
$this->expectExceptionMessage('Invalid response from payment gateway (no data)');
284287
$this->response = new CompletePurchaseResponse(
285288
$this->getMockRequest(),
286289
array(
@@ -291,11 +294,12 @@ public function testCompletePurchaseInvalidNoSignatureDefinition()
291294
}
292295

293296
/**
294-
* @expectedException Omnipay\Common\Exception\InvalidResponseException
295-
* @expectedExceptionMessage Invalid response from payment gateway (no data)
297+
* @doesNotPerformAssertions
296298
*/
297299
public function testCompletePurchaseInvalidNoSignature()
298300
{
301+
$this->expectException('Omnipay\Common\Exception\InvalidResponseException');
302+
$this->expectExceptionMessage('Invalid response from payment gateway (no data)');
299303
$this->response = new CompletePurchaseResponse(
300304
$this->getMockRequest(),
301305
array(
@@ -306,27 +310,30 @@ public function testCompletePurchaseInvalidNoSignature()
306310
}
307311

308312
/**
309-
* @expectedException Omnipay\Common\Exception\InvalidResponseException
310-
* @expectedExceptionMessage Invalid response from payment gateway (no data)
313+
* @doesNotPerformAssertions
311314
*/
312315
public function testCompletePurchaseInvalidEmptySignature()
313316
{
317+
$this->expectException('Omnipay\Common\Exception\InvalidResponseException');
318+
$this->expectExceptionMessage('Invalid response from payment gateway (no data)');
314319
$this->response = new CompletePurchaseResponse(
315320
$this->getMockRequest(),
316321
array(
317322
'decision' => 'ERROR',
318323
'signed_field_names' => 'decision',
319324
'signature' => '',
320-
)
325+
)
321326
);
322327
}
323328

324329
/**
325-
* @expectedException Omnipay\Common\Exception\InvalidResponseException
326-
* @expectedExceptionMessage Invalid response from payment gateway (signature mismatch)
330+
* @doesNotPerformAssertions
327331
*/
328332
public function testCompletePurchaseInvalidSignature()
329333
{
334+
$this->expectException('Omnipay\Common\Exception\InvalidResponseException');
335+
$this->expectExceptionMessage('Invalid response from payment gateway (signature mismatch)');
336+
330337
$this->getMockRequest()->shouldReceive('getSecretKey')->once()->andReturn($this->testSecretKey);
331338

332339
$this->response = new CompletePurchaseResponse(

0 commit comments

Comments
 (0)