10000 updated ecopayz endpoints by junosg · Pull Request #5 · dercoder/omnipay-ecopayz · GitHub
[go: up one dir, main page]

Skip to content

updated ecopayz endpoints #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ to your `composer.json` file:
```json
{
"require": {
"dercoder/omnipay-ecopayz": "~1.0"
"dercoder/omnipay-ecopayz": "~2.0.x-dev"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
"dev-master": "2.0.x-dev"
}
}
}
4 changes: 2 additions & 2 deletions src/Omnipay/Ecopayz/Message/AbstractRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ abstract class AbstractRequest extends \Omnipay\Common\Message\AbstractRequest
*
* @var string URL
*/
protected $testEndpoint = 'https://secure.test.ecopayz.com/services/MerchantAPI/MerchantAPIService.asmx';
protected $testEndpoint = 'https://merchantapi.test.payz.com/MerchantAPIService.asmx';

/**
* Live Endpoint URL
*
* @var string URL
*/
protected $liveEndpoint = 'https://secure.ecopayz.com/services/MerchantAPI/MerchantAPIService.asmx';
protected $liveEndpoint = 'https://merchantapi.payz.com/MerchantAPIService.asmx';

/**
* Get the Merchant ID
Expand Down
13 changes: 10 additions & 3 deletions src/Omnipay/Ecopayz/Message/PurchaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
*/
class PurchaseResponse extends AbstractResponse implements RedirectResponseInterface
{
protected $testEndpoint = 'https://secure.test.ecopayz.com/PrivateArea/WithdrawOnlineTransfer.aspx';
protected $liveEndpoint = 'https://secure.ecopayz.com/PrivateArea/WithdrawOnlineTransfer.aspx';
protected $testEndpoint = 'https://myaccount.test.payz.com/purchase/create';
protected $liveEndpoint = 'https://myaccount.payz.com/purchase/create';
protected $testRedirectEndpoint = 'https://myaccount.test.payz.com/purchase/request';
protected $redirectEndpoint = 'https://myaccount.payz.com/purchase/request';

public function __construct(RequestInterface $request, $data)
{
Expand All @@ -37,7 +39,7 @@ public function isRedirect()

public function getRedirectUrl()
{
return $this->getEndpoint() . '?' . http_build_query($this->data, '', '&');
return $this->getRedirectEndpoint() . '?' . http_build_query($this->data, '', '&');
}

public function getRedirectMethod()
Expand All @@ -54,4 +56,9 @@ protected function getEndpoint()
{
return $this->getRequest()->getTestMode() ? $this->testEndpoint : $this->liveEndpoint;
}

protected function getRedirectEndpoint()
{
return $this->getRequest()->getTestMode() ? $this->testRedirectEndpoint : $this->redirectEndpoint;
}
}
2 changes: 1 addition & 1 deletion tests/Omnipay/Ecopayz/Message/PurchaseResponseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function testResult()
$this->assertTrue($response->isRedirect());
$this->assertNull($response->getCode());
$this->assertNull($response->getMessage());
$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());
$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());
$this->assertSame('GET', $response->getRedirectMethod());
$this->assertNull($response->getRedirectData());
}
Expand Down
0