|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* Yii2 extension for payment processing with Omnipay, Payum and more later. |
|
4
|
|
|
* |
|
5
|
|
|
* @link https://github.com/hiqdev/yii2-merchant |
|
6
|
|
|
* @package yii2-merchant |
|
7
|
|
|
* @license BSD-3-Clause |
|
8
|
|
|
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/) |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace hiqdev\yii2\merchant\models; |
|
12
|
|
|
|
|
13
|
|
|
use Yii; |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* Class MerchantTrait. |
|
17
|
|
|
*/ |
|
18
|
|
|
trait MerchantTrait |
|
19
|
|
|
{ |
|
20
|
|
|
/** |
|
21
|
|
|
* {@inheritdoc} |
|
22
|
|
|
*/ |
|
23
|
|
|
public function rules() |
|
24
|
|
|
{ |
|
25
|
|
|
return [ |
|
26
|
|
|
[['name', 'system'], 'string'], |
|
27
|
|
|
[['purse'], 'string'], |
|
28
|
|
|
[['method'], 'string'], |
|
29
|
|
|
[['currency'], 'string'], |
|
30
|
|
|
[['label'], 'string'], |
|
31
|
|
|
[['amount', 'fee'], 'number'], |
|
32
|
|
|
[['commission'], 'number'], |
|
33
|
|
|
[['invoice_id'], 'number'], |
|
34
|
|
|
[['action'], 'string'], |
|
35
|
|
|
]; |
|
36
|
|
|
} |
|
37
|
|
|
|
|
38
|
|
|
/** |
|
39
|
|
|
* {@inheritdoc} |
|
40
|
|
|
*/ |
|
41
|
|
|
public function attributeLabels() |
|
42
|
|
|
{ |
|
43
|
|
|
return [ |
|
44
|
|
|
'name' => Yii::t('merchant', 'Name'), |
|
45
|
|
|
'system' => Yii::t('merchant', 'Payment System'), |
|
46
|
|
|
'purse' => Yii::t('merchant', 'Purse'), |
|
47
|
|
|
'amount' => Yii::t('merchant', 'Amount'), |
|
48
|
|
|
'fee' => Yii::t('merchant', 'Fee'), |
|
49
|
|
|
'currency' => Yii::t('merchant', 'Currency'), |
|
50
|
|
|
'signature' => Yii::t('merchant', 'Signature'), |
|
51
|
|
|
'commission' => Yii::t('merchant', 'Commission'), |
|
52
|
|
|
]; |
|
53
|
|
|
} |
|
54
|
|
|
} |
|
55
|
|
|
|