Skip to content

Commit

Permalink
Update to Omnipay v3
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverFire committed Oct 17, 2019
1 parent 86012a9 commit ef5b933
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
9 changes: 7 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,21 @@
}
],
"require": {
"omnipay/common": "~2.3"
"omnipay/common": "^3.0"
},
"require-dev": {
"omnipay/tests": "~2.0",
"omnipay/tests": "^3.0",
"hiqdev/hidev-php": "*",
"hiqdev/hidev-hiqdev": "*"
},
"autoload": {
"psr-4": {
"Omnipay\\ePayService\\": "src"
}
},
"extra": {
"branch-alias": {
"dev-master": "3.0.x-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/Message/CompletePurchaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function getTransactionId()

public function getTransactionReference()
{
return $this->data['EPS_TRID'];
return $this->data['EPS_ACCNUM'];
}

public function getAmount()
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/Message/CompletePurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@

use Omnipay\Tests\TestCase;
use Symfony\Component\HttpFoundation\Request as HttpRequest;
use Omnipay\ePayService\Message\CompletePurchaseResponse;

class CompletePurchaseRequestTest extends TestCase
{
private $request;

private $purse = 'ec12345';
private $secret = '22SAD#-78G8sdf$88';
private $hash = '1d4d18e1eea386654e1af89e89f1a104'; // d41d8cd98f00b204e9800998ecf8427e 954f1176a05a5921118f49285beea2bb
private $hash = 'f974945d5549c760f8f3c9582da49d6e';
private $description = 'Test Transaction long description';
private $transactionId = '1SD672345A890sd';
private $transactionReference = 'sdfa1SD672345A8';
Expand Down Expand Up @@ -66,6 +67,6 @@ public function testSendData()
{
$data = $this->request->getData();
$response = $this->request->sendData($data);
$this->assertInstanceOf('Omnipay\ePayService\Message\CompletePurchaseResponse', $response);
$this->assertInstanceOf(CompletePurchaseResponse::class, $response);
}
}
6 changes: 4 additions & 2 deletions tests/unit/Message/CompletePurchaseResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@
namespace Omnipay\ePayService\Message;

use Omnipay\Tests\TestCase;
use Omnipay\Common\Exception\InvalidResponseException;

class CompletePurchaseResponseTest extends TestCase
{
private $request;

private $purse = 'ec12345';
private $secret = '22SAD#-78G8sdf$88';
private $hash = '1d4d18e1eea386654e1af89e89f1a104'; // d41d8cd98f00b204e9800998ecf8427e 954f1176a05a5921118f49285beea2bb
private $hash = 'f974945d5549c760f8f3c9582da49d6e';
private $description = 'Test Transaction long description';
private $transactionId = '1SD672345A890sd';
private $transactionReference = 'sdfa1SD672345A8';
Expand All @@ -40,7 +41,8 @@ public function setUp()

public function testInvalidHashException()
{
$this->setExpectedException('Omnipay\Common\Exception\InvalidResponseException', 'Invalid hash');
$this->expectException(InvalidResponseException::class);
$this->expectExceptionMessage('Invalid hash');
new CompletePurchaseResponse($this->request, [
'description' => $this->description,
'purse' => $this->purse,
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Message/PurchaseRequestTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@ public function testSendData()
{
$data = $this->request->getData();
$response = $this->request->sendData($data);
$this->assertSame('Omnipay\ePayService\Message\PurchaseResponse', get_class($response));
$this->assertInstanceOf(\Omnipay\ePayService\Message\PurchaseResponse::class, $response);
}
}

0 comments on commit ef5b933

Please sign in to comment.