PluginProbe
PayPlug for WooCommerce (Official) / 3.1.0
PayPlug for WooCommerce (Official) v3.1.0
3.1.0 3.0.0 2.18.0 1.0.17 1.0.18 1.0.19 1.0.20 1.0.21 1.0.22 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 1.10.0 1.10.1 1.2.1 1.2.10 1.2.11 1.2.2 1.2.3 1.2.4 1.2.5 All 102 releases
← All changes | src/Gateway/PayplugGatewayOney4x.php +9 -35 1.2.2 → 3.1.0 View file →
@@ -8,21 +8,19 @@
8 8 }
9 9
10 10 /**
11 11 * PayPlug WooCommerce Gateway.
12 - *
13 - * @package Payplug\PayplugWoocommerce\Gateway
14 12 */
15 13 class PayplugGatewayOney4x extends PayplugGatewayOney3x
16 14 {
17 -
18 15 public function __construct()
19 16 {
20 17 parent::__construct();
21 - $this->id = 'oney_x4_with_fees';
22 - $this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug');
18 + $this->id = 'oney_x4_with_fees';
19 + $this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug');
23 20 $this->method_description = __('Enable PayPlug Oney 4x for your customers.', 'payplug');
24 - $this->title = __('Pay by card in 4x with Oney', 'payplug');
21 + $this->title = __('Pay by card in 4x with Oney', 'payplug');
22 + $this->has_fields = true;
25 23 }
26 24
27 25 /**
28 26 * Get payment icons.
@@ -30,42 +28,18 @@
30 28 * @return string
31 29 */
32 30 public function get_icon()
33 31 {
34 - parent::get_icon();
35 - if ($this->check_oney_is_available() === true) {
36 - $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency'));
37 - $f = function ($fn) {
38 - return $fn;
39 - };
40 - $this->description = <<<HTML
41 - <p>
42 - <div class="payplug-oney-flex">
43 - <div>{$f(__('Bring', 'payplug'))} :</div>
44 - <div>{$this->oney_response['x4_with_fees']['down_payment_amount']} {$currency}</div>
45 - </div>
46 - <div class="payplug-oney-flex">
47 - <div>{$f(__('1st monthly payment', 'payplug'))} :</div>
48 - <div>{$this->oney_response['x4_with_fees']['installments'][0]['amount']} {$currency}</div>
49 - </div>
50 - <div class="payplug-oney-flex">
51 - <div>{$f(__('2nd monthly payment', 'payplug'))} :</div>
52 - <div>{$this->oney_response['x4_with_fees']['installments'][1]['amount']} {$currency}</div>
53 - </div>
54 - <div class="payplug-oney-flex">
55 - <div>{$f(__('3rd monthly payment', 'payplug'))} :</div>
56 - <div>{$this->oney_response['x4_with_fees']['installments'][2]['amount']} {$currency}</div>
57 - </div>
58 - </p>
59 -HTML;
60 - }
61 - $available_img = ($this->check_oney_is_available() === true) ? 'lg-4xoney-checkout.png' : 'lg-4xoney-checkout-disabled.png';
32 + $disable = $this->check_oney_is_available() === true ? '' : 'disable-checkout-icons';
33 + $available_img = 'x4_with_fees.svg';
34 +
62 35 $icons = apply_filters('payplug_payment_icons', [
63 - 'payplug' => sprintf('<img src="%s" alt="Oney 3x" class="payplug-payment-icon" />', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/' . $available_img)),
36 + 'payplug' => sprintf('<img src="%s" alt="Oney 4x" class="payplug-payment-icon ' . $disable . '" />', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/checkout/' . $available_img)),
64 37 ]);
65 38 $icons_str = '';
66 39 foreach ($icons as $icon) {
67 40 $icons_str .= $icon;
68 41 }
42 +
69 43 return $icons_str;
70 44 }
71 45 }