1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @link https://github.com/yiiviet/yii2-payment |
4
|
|
|
* @copyright Copyright (c) 2017 Yii Viet |
5
|
|
|
* @license [New BSD License](http://www.opensource.org/licenses/bsd-license.php) |
6
|
|
|
*/ |
7
|
|
|
|
8
|
|
|
namespace yiiviet\payment\momo; |
9
|
|
|
|
10
|
|
|
use yiiviet\payment\VerifiedData as BaseVerifiedData; |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* Lớp VerifiedData |
14
|
|
|
* |
15
|
|
|
* @method PaymentClient getClient() đối tượng client đã dùng để thực thi request. |
16
|
|
|
* |
17
|
|
|
* @property PaymentClient $client đối tượng client đã dùng để thực thi request. |
18
|
|
|
* @property string $partnerCode của client sử dụng khi tạo request purchase. |
19
|
|
|
* @property string $accessKey của client sử dụng khi tạo request purchase. |
20
|
|
|
* @property mixed $requestId mã unique request id khi tạo request purchase |
21
|
|
|
* @property double $amount số tiền của đơn hàng. |
22
|
|
|
* @property string $orderId mã đơn hàng tại hệ thống. |
23
|
|
|
* @property string $orderType có giá trị cố định là `momo_wallet`. |
24
|
|
|
* @property string $transId mã giao dịch tại MOMO. |
25
|
|
|
* @property string $message thống báo (eng). |
26
|
|
|
* @property string $localMessage thống báo (vi). |
27
|
|
|
* @property string $responseTime thời gian phản hồi. |
28
|
|
|
* @property int $errorCode mã báo lỗi. |
29
|
|
|
* @property string $payType hình thức thanh toán (web hoặc qr). |
30
|
|
|
* @property mixed $extraData dữ liệu kèm theo khi tạo request purchase. |
31
|
|
|
* |
32
|
|
|
* @author Vuong Minh <[email protected]> |
33
|
|
|
* @since 1.0.3 |
34
|
|
|
*/ |
35
|
|
|
class VerifiedData extends BaseVerifiedData |
36
|
|
|
{ |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @inheritdoc |
40
|
|
|
*/ |
41
|
2 |
|
public function rules() |
42
|
|
|
{ |
43
|
|
|
return [ |
44
|
2 |
|
[['signature'], 'required', 'on' => [ |
45
|
|
|
PaymentGateway::VRC_PURCHASE_SUCCESS, PaymentGateway::VRC_IPN |
46
|
|
|
]], |
47
|
|
|
[['signature'], SignatureValidator::class, 'dataSignAttributes' => [ |
48
|
|
|
'partnerCode', 'accessKey', 'requestId', 'amount', 'orderId', 'orderInfo', 'orderType', |
49
|
|
|
'transId', 'message', 'localMessage', 'responseTime', 'errorCode', 'payType', 'extraData' |
50
|
2 |
|
], 'client' => $this->getClient(), 'on' => [ |
51
|
|
|
PaymentGateway::VRC_PURCHASE_SUCCESS, PaymentGateway::VRC_IPN |
52
|
|
|
]] |
53
|
|
|
]; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
} |
57
|
|
|
|