| 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 |
|