Completed
Push — master ( 60539d...725f3a )
by Dmitry
07:23
created

DepositForm::attributeLabels()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
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
use yii\base\Model;
15
16
/**
17
 * Class Deposit.
18
 */
19
class DepositForm extends Model
20
{
21
    /**
22
     * @var float the amount of money
23
     */
24
    public $amount;
25
26
    /**
27
     * @var string the route that will be passed to merchant
28
     * in order to redirect user to a custom page
29
     */
30
    public $finishUrl;
31
32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function rules()
36
    {
37
        return [
38
            [['amount'], 'number'],
39
            [['amount'], 'required'],
40
            [['amount'], 'compare', 'operator' => '>', 'compareValue' => 0],
41
        ];
42
    }
43
44
    public function attributes()
45
    {
46
        return ['amount'];
47
    }
48
49
    /**
50
     * {@inheritdoc}
51
     */
52
    public function attributeLabels()
53
    {
54
        return [
55
            'amount' => Yii::t('merchant', 'Amount'),
56
        ];
57
    }
58
}
59