Skip to content

Commit 539b3e8

Browse files
committed
Merge branch 'master' of github.com:thephpleague/omnipay-sagepay
2 parents 7ccadb4 + c36ea1e commit 539b3e8

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic,
1010
multi-gateway payment processing library for PHP.
1111
This package implements Sage Pay support for Omnipay.
12-
This version only supports PHP 7.1+.
12+
This version supports PHP ^5.6 and PHP ^7.
1313

1414
This is the `master` branch of Omnipay, handling Omnipay version `3.x`.
1515
For the `2.x` branch, please visit https://github.com/thephpleague/omnipay-sagepay/tree/2.x
@@ -629,10 +629,10 @@ $gateway = OmniPay::create('SagePay\Form')->initialize([
629629

630630
The `encryptionKey` is generated in "My Sage Pay" when logged in as the administrator.
631631

632-
Note that this gateway will assume all input data (names, addresses etc.)
632+
Note that this gateway driver will assume all input data (names, addresses etc.)
633633
are UTF-8 encoded.
634634
It will then recode the data to ISO8859-1 before encrypting it for the gateway,
635-
as the gateway strictly accepts ISO8859-1 only, regardless of what encoding is
635+
since the gateway strictly accepts ISO8859-1 only, regardless of what encoding is
636636
used to submit the form from the merchant site.
637637
If you do not want this conversion to happen, it can be disabled with this parameter:
638638

composer.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
}
3131
},
3232
"require": {
33+
"php": "^5.6|^7",
3334
"omnipay/common": "~3.0"
3435
},
3536
"require-dev": {

tests/Message/ResponseTest.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Omnipay\SagePay\Message;
44

5+
use Omnipay\Common\Message\RequestInterface;
56
use Omnipay\Tests\TestCase;
67

78
class ResponseTest extends TestCase
@@ -100,4 +101,25 @@ public function testDirectPurchaseWithToken()
100101
$this->assertTrue($response->isSuccessful());
101102
$this->assertSame('{ABCDEFGH-ABCD-ABCD-ABCD-ABCDEFGHIJKL}', $response->getToken());
102103
}
104+
105+
106+
public function testRedirectMethodIsPost()
107+
{
108+
$httpResponse = new Response($this->prophesize(RequestInterface::class)->reveal(), []);
109+
$this->assertEquals('POST', $httpResponse->getRedirectMethod());
110+
}
111+
112+
public function testDataGetters()
113+
{
114+
$vPSTxId = (string) rand(0, 100);
115+
$securityKey = (string) rand(0, 100);
116+
$data = [
117+
'VPSTxId' => $vPSTxId,
118+
'SecurityKey' => $securityKey,
119+
];
120+
$httpResponse = new Response($this->prophesize(RequestInterface::class)->reveal(), $data);
121+
122+
$this->assertEquals($vPSTxId, $httpResponse->getVPSTxId());
123+
$this->assertEquals($securityKey, $httpResponse->getSecurityKey());
124+
}
103125
}

0 commit comments

Comments
 (0)