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
payplug / src / Gateway / PayplugGatewayOney3xWithoutFees.php

PayplugGatewayOney3xWithoutFees.php in PayPlug for WooCommerce (Official) 3.1.0, at src/Gateway/PayplugGatewayOney3xWithoutFees.php

54 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Payplug\PayplugWoocommerce\Gateway;
4
5 // Exit if accessed directly
6 use Payplug\PayplugWoocommerce\PayplugWoocommerceHelper;
7
8 if (!defined('ABSPATH')) {
9 exit;
10 }
11
12 /**
13 * PayPlug WooCommerce Gateway.
14 */
15 class PayplugGatewayOney3xWithoutFees extends PayplugGatewayOney3x
16 {
17 public function __construct()
18 {
19 parent::__construct();
20 $this->id = 'oney_x3_without_fees';
21 $this->method_title = _x('PayPlug Oney 3x', 'Gateway method title', 'payplug');
22 $this->method_description = __('Enable PayPlug Oney 3x for your customers.', 'payplug');
23 $this->title = __('Pay by credit card in 3x installments without fees with Oney', 'payplug');
24 $this->has_fields = true;
25 }
26
27 /**
28 * Get payment icons.
29 *
30 * @return string
31 */
32 public function get_icon()
33 {
34 $disable = $this->check_oney_is_available() === true ? '' : 'disable-checkout-icons';
35 $country = PayplugWoocommerceHelper::getISOCountryCode();
36
37 if (file_exists(PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg')) {
38 $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_' . $country . '.svg';
39 } else {
40 $image = PAYPLUG_GATEWAY_PLUGIN_URL . 'assets/images/checkout/x3_without_fees_FR.svg';
41 }
42
43 $icons = apply_filters('payplug_payment_icons', [
44 'payplug' => sprintf('<img src="%s" alt="Oney 3x" class="payplug-payment-icon ' . $disable . '" />', esc_url($image)),
45 ]);
46 $icons_str = '';
47 foreach ($icons as $icon) {
48 $icons_str .= $icon;
49 }
50
51 return $icons_str;
52 }
53 }
54