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/PayplugGatewayOney3xWithoutFees.php +2 -47 3.0.0 → 3.1.0 View file →
@@ -20,9 +20,9 @@
20 20 $this->id = 'oney_x3_without_fees';
21 21 $this->method_title = _x('PayPlug Oney 3x', 'Gateway method title', 'payplug');
22 22 $this->method_description = __('Enable PayPlug Oney 3x for your customers.', 'payplug');
23 23 $this->title = __('Pay by credit card in 3x installments without fees with Oney', 'payplug');
24 - $this->has_fields = false;
24 + $this->has_fields = true;
25 25 }
26 26
27 27 /**
28 28 * Get payment icons.
@@ -30,54 +30,9 @@
30 30 * @return string
31 31 */
32 32 public function get_icon()
33 33 {
34 - $disable = '';
35 - if ($this->check_oney_is_available() === true) {
36 - $total_price = floatval(WC()->cart->total);
37 - $this->oney_response = $this->payplug_api->simulate_oney_payment($total_price, 'without_fees');
38 -
39 - if (empty($this->oney_response)) {
40 - $disable = 'disable-checkout-icons';
41 - }
42 -
43 - $currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency'));
44 - $f = fn ($fn) => $fn;
45 -
46 - if (is_array($this->oney_response)) {
47 - $total_price_oney = floatval($this->oney_response['x3_without_fees']['down_payment_amount']);
48 - foreach ($this->oney_response['x3_without_fees']['installments'] as $installment) {
49 - $total_price_oney = $total_price_oney + floatval($installment['amount']);
50 - }
51 -
52 - $this->description = <<<HTML
53 - <div class="payplug-oney-flex">
54 - <div><b>{$f(__('oney_total', 'payplug'))}</b></div>
55 - <div><b>{$total_price_oney} {$currency}</b></div>
56 - </div>
57 - <div class="payplug-oney-flex">
58 - <div>{$f(__('Bring', 'payplug'))}:</div>
59 - <div>{$this->oney_response['x3_without_fees']['down_payment_amount']} {$currency}</div>
60 - </div>
61 - <div class="payplug-oney-flex">
62 - <div>{$f(__('1st monthly payment', 'payplug'))}:</div>
63 - <div>{$this->oney_response['x3_without_fees']['installments'][0]['amount']} {$currency}</div>
64 - </div>
65 - <div class="payplug-oney-flex">
66 - <div>{$f(__('2nd monthly payment', 'payplug'))}:</div>
67 - <div>{$this->oney_response['x3_without_fees']['installments'][1]['amount']} {$currency}</div>
68 - </div>
69 - <div>
70 -{$f(__('oney_financing_cost', 'payplug'))} {$this->oney_response['x3_without_fees']['nominal_annual_percentage_rate']} {$currency} TAEG : {$this->oney_response['x3_without_fees']['effective_annual_percentage_rate']} %
71 - </div>
72 -HTML;
73 - } else {
74 - $this->description = $this->oney_response;
75 - }
76 - } else {
77 - $disable = 'disable-checkout-icons';
78 - }
79 -
34 + $disable = $this->check_oney_is_available() === true ? '' : 'disable-checkout-icons';
80 35 $country = PayplugWoocommerceHelper::getISOCountryCode();
81 36
82 37 if (file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg')) {
83 38 $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg';