Skip to content

Commit c6c077e

Browse files
Clean endpoint
1 parent 2317b7e commit c6c077e

File tree

2 files changed

+2
-26
lines changed

2 files changed

+2
-26
lines changed

src/Message/Concerns/RequestEndpoint.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,13 @@
1313
*/
1414
trait RequestEndpoint
1515
{
16-
/**
17-
* Đường dẫn kết nối đến VTCPay để test.
18-
*
19-
* @var string
20-
*/
21-
protected $testEndPoint;
22-
23-
/**
24-
* Đường dẫn kết nối đến VTCPay ở môi trường production.
25-
*
26-
* @var string
27-
*/
28-
protected $productionEndpoint;
29-
3016
/**
3117
* Trả về url kết nối MoMo.
3218
*
3319
* @return string
3420
*/
3521
protected function getEndpoint(): string
3622
{
37-
return $this->getTestMode() ? $this->testEndPoint : $this->productionEndpoint;
23+
return $this->getTestMode() ? 'http://alpha1.vtcpay.vn/portalgateway' : 'https://vtcpay.vn/bank-gateway';
3824
}
3925
}

src/Message/PurchaseRequest.php

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,6 @@ class PurchaseRequest extends AbstractRequest
1717
use Concerns\RequestEndpoint;
1818
use Concerns\RequestSignature;
1919

20-
/**
21-
* {@inheritdoc}
22-
*/
23-
protected $testEndPoint = 'https://vtcpay.vn/bank-gateway/checkout.html';
24-
25-
/**
26-
* {@inheritdoc}
27-
*/
28-
protected $productionEndpoint = 'http://alpha1.vtcpay.vn/portalgateway/checkout.html';
29-
3020
/**
3121
* {@inheritdoc}
3222
*/
@@ -59,7 +49,7 @@ public function getData(): array
5949
*/
6050
public function sendData($data): PurchaseResponse
6151
{
62-
$redirectUrl = $this->getEndpoint().'?'.http_build_query($data);
52+
$redirectUrl = $this->getEndpoint().'/checkout.html?'.http_build_query($data);
6353

6454
return $this->response = new PurchaseResponse($this, $data, $redirectUrl);
6555
}

0 commit comments

Comments
 (0)