-
Notifications
You must be signed in to change notification settings - Fork 3
/
labelsClasses.php
63 lines (51 loc) · 2 KB
/
labelsClasses.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
class payment_robokassa_pay_method_request_all extends \Robokassa\Payment\WC_WP_robokassa {
public function __construct() {
$this->id = 'robokassa';
$this->method_title = 'Robokassa';
$this->long_name = 'Оплата через Robokassa';
$this->description = get_option('RobokassaOrderPageDescription', 'Оплатить через Robokassa');
parent::__construct();
}
}
class payment_robokassa_pay_method_request_Podeli extends \Robokassa\Payment\WC_WP_robokassa {
public function __construct() {
$this->id = 'robokassa_podeli';
$this->method_title = 'Robokassa';
$this->long_name='Оплата через Robokassa';
$this->title = 'Robokassa Х Подели';
ob_start();
podeli_checkout_widget();
$podeli_widget_content = ob_get_clean();
$this->description = '25% сегодня, остальное - тремя платежами раз в 2 недели' . $podeli_widget_content;
parent::__construct();
}
}
class payment_robokassa_pay_method_request_Credit extends \Robokassa\Payment\WC_WP_robokassa {
public function __construct() {
$this->id = 'robokassa_credit';
$this->method_title = 'Robokassa';
$this->long_name='Оплата через Robokassa';
$this->title = 'Рассрочка или кредит';
ob_start();
credit_checkout_widget();
$credit_widget_content = ob_get_clean();
$this->description = $credit_widget_content;
parent::__construct();
}
}
/**
* @var array $methods
*
* @return array
*/
function robokassa_payment_add_WC_WP_robokassa_class($methods = null) {
$methods[] = 'payment_robokassa_pay_method_request_all';
if (get_option('robokassa_podeli') == '1') {
$methods[] = 'payment_robokassa_pay_method_request_Podeli';
}
if (get_option('robokassa_credit') == '1') {
$methods[] = 'payment_robokassa_pay_method_request_Credit';
}
return $methods;
}