id = 'oney_x4_with_fees';
$this->method_title = _x('PayPlug Oney 4x', 'Gateway method title', 'payplug');
$this->method_description = __('Enable PayPlug Oney 4x for your customers.', 'payplug');
$this->title = __('Pay by card in 4x with Oney', 'payplug');
}
/**
* Get payment icons.
*
* @return string
*/
public function get_icon()
{
parent::get_icon();
if ($this->check_oney_is_available() === true) {
$currency = get_woocommerce_currency_symbol(get_option('woocommerce_currency'));
$f = function ($fn) {
return $fn;
};
if(is_array($this->oney_response)) {
$this->description = <<
{$f(__('Bring', 'payplug'))} :
{$this->oney_response['x4_with_fees']['down_payment_amount']} {$currency}
{$f(__('1st monthly payment', 'payplug'))} :
{$this->oney_response['x4_with_fees']['installments'][0]['amount']} {$currency}
{$f(__('2nd monthly payment', 'payplug'))} :
{$this->oney_response['x4_with_fees']['installments'][1]['amount']} {$currency}
{$f(__('3rd monthly payment', 'payplug'))} :
{$this->oney_response['x4_with_fees']['installments'][2]['amount']} {$currency}
HTML;
} else {
$this->description = $this->oney_response;
}
}
$available_img = ($this->check_oney_is_available() === true) ? 'lg-4xoney-checkout.png' : 'lg-4xoney-checkout-disabled.png';
$icons = apply_filters('payplug_payment_icons', [
'payplug' => sprintf('
', esc_url(PAYPLUG_GATEWAY_PLUGIN_URL . '/assets/images/' . $available_img)),
]);
$icons_str = '';
foreach ($icons as $icon) {
$icons_str .= $icon;
}
return $icons_str;
}
}