8000 updated getRedirectEndpoint and version · dercoder/omnipay-ecopayz@8823c75 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8823c75

Browse files
committed
updated getRedirectEndpoint and version
1 parent d274e46 commit 8823c75

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ to your `composer.json` file:
2222
```json
2323
{
2424
"require": {
25-
"dercoder/omnipay-ecopayz": "~1.0"
25+
"dercoder/omnipay-ecopayz": "~2.0.x-dev"
2626
}
2727
}
2828
```

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
},
2626
"extra": {
2727
"branch-alias": {
28-
"dev-master": "1.0.x-dev"
28+
"dev-master": "2.0.x-dev"
2929
}
3030
}
3131
}

src/Omnipay/Ecopayz/Message/PurchaseResponse.php

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
*/
1717
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
1818
{
19-
protected $testEndpoint = 'https://secure.test.ecopayz.com/PrivateArea/WithdrawOnlineTransfer.aspx';
20-
protected $liveEndpoint = 'https://secure.ecopayz.com/PrivateArea/WithdrawOnlineTransfer.aspx';
19+
protected $testEndpoint = 'https://myaccount.test.payz.com/purchase/create';
20+
protected $liveEndpoint = 'https://myaccount.payz.com/purchase/create';
21+
protected $testRedirectEndpoint = 'https://myaccount.test.payz.com/purchase/request';
22+
protected $redirectEndpoint = 'https://myaccount.payz.com/purchase/request';
2123

2224
public function __construct(RequestInterface $request, $data)
2325
{
@@ -37,7 +39,7 @@ public function isRedirect()
3739

3840
public function getRedirectUrl()
3941
{
40-
return $this->getEndpoint() . '?' . http_build_query($this->data, '', '&');
42+
return $this->getRedirectEndpoint() . '?' . http_build_query($this->data, '', '&');
4143
}
4244

4345
public function getRedirectMethod()
@@ -54,4 +56,9 @@ protected function getEndpoint()
5456
{
5557
return $this->getRequest()->getTestMode() ? $this->testEndpoint : $this->liveEndpoint;
5658
}
59+
60+
protected function getRedirectEndpoint()
61+
{
62+
return $this->getRequest()->getTestMode() ? $this->testRedirectEndpoint : $this->redirectEndpoint;
63+
}
5764
}

tests/Omnipay/Ecopayz/Message/PurchaseResponseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function testResult()
2525
$this->assertTrue($response->isRedirect());
2626
$this->assertNull($response->getCode());
2727
$this->assertNull($response->getMessage());
28-
$this->assertSame('https://secure.ecopayz.com/PrivateArea/WithdrawOnlineTransfer.aspx?PaymentPageID=100&MerchantAccountNumber=100001&CustomerIdAtMerchant=1123456789&TxID=TX4567890&Amount=12.34&Currency=EUR&MerchantFreeText=Free+Text+Description&Checksum=84bbad2a636aa9226c03f17ff813a181', $response->getRedirectUrl());
28+
$this->assertSame('https://myaccount.payz.com/purchase/request?PaymentPageID=100&MerchantAccountNumber=100001&CustomerIdAtMerchant=1123456789&TxID=TX4567890&Amount=12.34&Currency=EUR&MerchantFreeText=Free+Text+Description&Checksum=84bbad2a636aa9226c03f17ff813a181', $response->getRedirectUrl());
2929
$this->assertSame('GET', $response->getRedirectMethod());
3030
$this->assertNull($response->getRedirectData());
3131
}

0 commit comments

Comments
 (0)
0