Skip to content

Commit

Permalink
Merge branch 'master' of github.com:thephpleague/omnipay-sagepay
Browse files Browse the repository at this point in the history
  • Loading branch information
judgej committed Nov 14, 2018
2 parents 7ccadb4 + c36ea1e commit 539b3e8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[Omnipay](https://github.com/thephpleague/omnipay) is a framework agnostic,
multi-gateway payment processing library for PHP.
This package implements Sage Pay support for Omnipay.
This version only supports PHP 7.1+.
This version supports PHP ^5.6 and PHP ^7.

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

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

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

Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
}
},
"require": {
"php": "^5.6|^7",
"omnipay/common": "~3.0"
},
"require-dev": {
Expand Down
22 changes: 22 additions & 0 deletions tests/Message/ResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Omnipay\SagePay\Message;

use Omnipay\Common\Message\RequestInterface;
use Omnipay\Tests\TestCase;

class ResponseTest extends TestCase
Expand Down Expand Up @@ -100,4 +101,25 @@ public function testDirectPurchaseWithToken()
$this->assertTrue($response->isSuccessful());
$this->assertSame('{ABCDEFGH-ABCD-ABCD-ABCD-ABCDEFGHIJKL}', $response->getToken());
}


public function testRedirectMethodIsPost()
{
$httpResponse = new Response($this->prophesize(RequestInterface::class)->reveal(), []);
$this->assertEquals('POST', $httpResponse->getRedirectMethod());
}

public function testDataGetters()
{
$vPSTxId = (string) rand(0, 100);
$securityKey = (string) rand(0, 100);
$data = [
'VPSTxId' => $vPSTxId,
'SecurityKey' => $securityKey,
];
$httpResponse = new Response($this->prophesize(RequestInterface::class)->reveal(), $data);

$this->assertEquals($vPSTxId, $httpResponse->getVPSTxId());
$this->assertEquals($securityKey, $httpResponse->getSecurityKey());
}
}

0 comments on commit 539b3e8

Please sign in to comment.