Skip to content

Commit b12520e

Browse files
Updated OnePay gateway apis
1 parent 8e76675 commit b12520e

File tree

3 files changed

+54
-6
lines changed

3 files changed

+54
-6
lines changed

src/Facades/OnePay/DomesticGateway.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
namespace PHPViet\Laravel\Omnipay\Facades\OnePay;
1010

11-
use Illuminate\Support\Facades\Facade;
12-
1311
/**
12+
* @method static \Omnipay\OnePay\Message\DomesticPurchaseRequest purchase(array $options = [])
13+
* @method static \Omnipay\OnePay\Message\DomesticCompletePurchaseRequest completePurchase(array $options = [])
14+
* @method static \Omnipay\OnePay\Message\DomesticCompletePurchaseRequest notification(array $options = [])
15+
* @method static \Omnipay\OnePay\Message\DomesticFetchCheckoutRequest queryTransaction(array $options = [])
16+
*
1417
* @author Vuong Minh <vuongxuongminh@gmail.com>
1518
* @since 1.0.0
1619
*/
17-
class DomesticGateway extends Facade
20+
class DomesticGateway extends Gateway
1821
{
1922
/**
2023
* {@inheritdoc}

src/Facades/OnePay/Gateway.php

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?php
2+
/**
3+
* @link https://github.com/phpviet/laravel-omnipay
4+
*
5+
* @copyright (c) PHP Viet
6+
* @license [MIT](https://opensource.org/licenses/MIT)
7+
*/
8+
9+
namespace PHPViet\Laravel\Omnipay\Facades\OnePay;
10+
11+
use Illuminate\Support\Facades\Facade;
12+
13+
/**
14+
* @author Vuong Minh <vuongxuongminh@gmail.com>
15+
* @since 1.0.0
16+
*/
17+
class Gateway extends Facade
18+
{
19+
/**
20+
* Phương thức tạo yêu cầu truy vấn thông tin giao dịch đến OnePay.
21+
*
22+
* Đây là phương thức ánh xạ của [[fetchCheckout()]] với mục đích đồng bộ các phương thức so với các cổng thanh toán khác.
23+
*
24+
* @param array $options
25+
* @return mixed
26+
*/
27+
public static function queryTransaction(array $options = [])
28+
{
29+
return static::fetchCheckout($options);
30+
}
31+
32+
/**
33+
* Phương thức tạo yêu cầu IPN request do OnePay gửi sang.
34+
*
35+
* @param array $options
36+
* @return mixed
37+
*/
38+
public static function notification(array $options = [])
39+
{
40+
return static::completePurchase($options);
41+
}
42+
}

src/Facades/OnePay/InternationalGateway.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
namespace PHPViet\Laravel\Omnipay\Facades\OnePay;
1010

11-
use Illuminate\Support\Facades\Facade;
12-
1311
/**
12+
* @method static \Omnipay\OnePay\Message\InternationalPurchaseRequest purchase(array $options = [])
13+
* @method static \Omnipay\OnePay\Message\InternationalCompletePurchaseRequest completePurchase(array $options = [])
14+
* @method static \Omnipay\OnePay\Message\InternationalCompletePurchaseRequest notification(array $options = [])
15+
* @method static \Omnipay\OnePay\Message\InternationalFetchCheckoutRequest queryTransaction(array $options = [])
16+
*
1417
* @author Vuong Minh <vuongxuongminh@gmail.com>
1518
* @since 1.0.0
1619
*/
17-
class InternationalGateway extends Facade
20+
class InternationalGateway extends Gateway
1821
{
1922
/**
2023
* {@inheritdoc}

0 commit comments

Comments
 (0)