Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 60ef48c

Browse files
Added Gateway
1 parent 8191f6a commit 60ef48c

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

‎src/Gateway.php

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?php
2+
/**
3+
* @link https://github.com/phpviet/omnipay-vtcpay
4+
*
5+
* @copyright (c) PHP Viet
6+
* @license [MIT](https://opensource.org/licenses/MIT)
7+
*/
8+
9+
namespace Omnipay\VTCPay;
10+
11+
use Omnipay\Common\AbstractGateway;
12+
use Omnipay\VTCPay\Message\PurchaseRequest;
13+
use Omnipay\VTCPay\Message\NotificationRequest;
14+
use Omnipay\VTCPay\Message\CompletePurchaseRequest;
15+
16+
/**
17+
* @author Vuong Minh <vuongxuongminh@gmail.com>
18+
* @since 1.0.0
19+
*/
20+
class Gateway extends AbstractGateway
21+
{
22+
use Concerns\Parameters;
23+
use Concerns\ParametersNormalize;
24+
25+
/**
26+
* {@inheritdoc}
27+
*/
28+
public function getName(): string
29+
{
30+
return 'VTCPay';
31+
}
32+
33+
/**
34+
* {@inheritdoc}
35+
*/
36+
public function initialize(array $parameters = [])
37+
{
38+
return parent::initialize(
39+
$this->normalizeParameters($parameters)
40+
);
41+
}
42+
43+
/**
44+
* {@inheritdoc}
45+
* @return \Omnipay\Common\Message\AbstractRequest|PurchaseRequest
46+
*/
47+
public function purchase(array $options = []): PurchaseRequest
48+
{
49+
return $this->createRequest(PurchaseRequest::class, $options);
50+
}
51+
52+
/**
53+
* {@inheritdoc}
54+
* @return \Omnipay\Common\Message\AbstractRequest|CompletePurchaseRequest
55+
*/
56+
public function completePurchase(array $options = []): CompletePurchaseRequest
57+
{
58+
return $this->createRequest(CompletePurchaseRequest::class, $options);
59+
}
60+
61+
/**
62+
* Khởi tạo IPN request tiếp nhận từ VTCPay gửi sang.
63+
*
64+
* @return \Omnipay\Common\Message\AbstractRequest|NotificationRequest
65+
*/
66+
public function notification(array $options = []): NotificationRequest
67+
{
68+
return $this->createRequest(NotificationRequest::class, $options);
69+
}
70+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /