File tree Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Expand file tree Collapse file tree 3 files changed +26
-3
lines changed Original file line number Diff line number Diff line change 99[ Omnipay] ( https://github.com/thephpleague/omnipay ) is a framework agnostic,
1010multi-gateway payment processing library for PHP.
1111This 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
1414This is the ` master ` branch of Omnipay, handling Omnipay version ` 3.x ` .
1515For 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
630630The ` 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.)
633633are UTF-8 encoded.
634634It 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
636636used to submit the form from the merchant site.
637637If you do not want this conversion to happen, it can be disabled with this parameter:
638638
Original file line number Diff line number Diff line change 3030 }
3131 },
3232 "require" : {
33+ "php" : " ^5.6|^7" ,
3334 "omnipay/common" : " ~3.0"
3435 },
3536 "require-dev" : {
Original file line number Diff line number Diff line change 22
33namespace Omnipay \SagePay \Message ;
44
5+ use Omnipay \Common \Message \RequestInterface ;
56use Omnipay \Tests \TestCase ;
67
78class 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}
You can’t perform that action at this time.
0 commit comments