1 | <?php |
||
22 | class PayButton extends \yii\base\Widget |
||
23 | { |
||
24 | const EVENT_RENDER_COMMENT = 'renderComment'; |
||
25 | |||
26 | /** |
||
27 | * @var AbstractRequest |
||
28 | */ |
||
29 | public $request; |
||
30 | |||
31 | /** |
||
32 | * @var array|string the URL for action |
||
33 | */ |
||
34 | public $action = ['/merchant/pay/request']; |
||
35 | |||
36 | /** |
||
37 | * {@inheritdoc} |
||
38 | */ |
||
39 | public function init() |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function run() |
||
53 | |||
54 | /** |
||
55 | * Renders the payment button. |
||
56 | * |
||
57 | * @return string |
||
58 | */ |
||
59 | public function renderButton() |
||
66 | |||
67 | /** |
||
68 | * Extracts merchant name from the [[request]] |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getMerchantName() |
||
75 | |||
76 | /** |
||
77 | * Renders the button comment. Normally triggers [[EVENT_RENDER_COMMENT]] event |
||
78 | */ |
||
79 | public function renderButtonComment() |
||
87 | |||
88 | public function formatMoney($sum) |
||
92 | } |
||
93 |