1 | <?php |
||
26 | class PayButton extends \yii\base\Widget |
||
27 | { |
||
28 | const EVENT_RENDER_COMMENT = 'renderComment'; |
||
29 | |||
30 | /** |
||
31 | * @var PurchaseRequest |
||
32 | */ |
||
33 | public $request; |
||
34 | |||
35 | /** |
||
36 | * @var DepositForm |
||
37 | */ |
||
38 | public $depositForm; |
||
39 | |||
40 | /** |
||
41 | * @var array|string the URL for action |
||
42 | */ |
||
43 | public $action = ['/merchant/pay/request']; |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function init() |
||
54 | |||
55 | protected function registerMerchantCss() |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function run() |
||
72 | |||
73 | /** |
||
74 | * Renders the payment button. |
||
75 | * |
||
76 | * @return string |
||
77 | */ |
||
78 | public function renderButton() |
||
91 | |||
92 | /** |
||
93 | * Extracts merchant name from the [[request]]. |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getMerchantName() |
||
100 | |||
101 | public function getTotalCommission() |
||
105 | |||
106 | public function includesVat(): bool |
||
110 | |||
111 | public function getVatRate(): float |
||
115 | |||
116 | public function getVatSum(): float |
||
120 | |||
121 | public function getButtonData() |
||
125 | |||
126 | /** |
||
127 | * Renders the button comment. Normally triggers [[EVENT_RENDER_COMMENT]] event. |
||
128 | */ |
||
129 | public function renderButtonComment() |
||
133 | |||
134 | public function formatMoney($sum) |
||
150 | |||
151 | public function isDisabled() |
||
155 | } |
||
156 |