getSimulation(); $x4 = $simulationResponse['x4_without_fees']; $x3 = $simulationResponse['x3_without_fees']; $financing_cost_3x = intval($x3['total_cost']) / 100; $financing_cost_4x = intval($x4['total_cost']) / 100; $f = function($fn) { return $fn; }; return <<

{$f(__('payplug_oneyIT_popup-withoutfees-title', 'payplug'))}

{$f(__('BY CREDIT CARD', 'payplug'))}

{$f(__('Bring', 'payplug'))}: {$x3['down_payment_amount']} €

{$f(sprintf(__('IT monthly payment of', 'payplug'),2))}: {$x3['installments'][0]['amount']} €

{$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_3x} €

{$f(__('TAEG', 'payplug'))}: {$x3['effective_annual_percentage_rate']} %

{$f(__('Bring', 'payplug'))}: {$x4['down_payment_amount']} €

{$f(sprintf(__('IT monthly payment of', 'payplug'), 3))}: {$x4['installments'][0]['amount']} €

{$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_4x} €

{$f(__('TAEG', 'payplug'))}: {$x4['effective_annual_percentage_rate']} %

HTML; } /** * @param OneyWithFees $oney * @return string */ static function simulationPopupContent($oney) { $simulationResponse = $oney->getSimulation(); $x4 = $simulationResponse['x4_with_fees']; $x3 = $simulationResponse['x3_with_fees']; $financing_cost_3x = intval($x3['total_cost']) / 100; $financing_cost_4x = intval($x4['total_cost']) / 100; $f = function($fn) { return $fn; }; return <<

{$f(__('payplug_oneyIT_popup-title', 'payplug'))}

{$f(__('BY CREDIT CARD', 'payplug'))}

{$f(__('Bring', 'payplug'))}: {$x3['down_payment_amount']} €

{$f(sprintf(__('IT monthly payment of', 'payplug'),2))}: {$x3['installments'][0]['amount']} €

{$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_3x} €

{$f(__('TAEG', 'payplug'))}: {$x3['effective_annual_percentage_rate']} %

{$f(__('Bring', 'payplug'))}: {$x4['down_payment_amount']} €

{$f(sprintf(__('IT monthly payment of', 'payplug'),3))}: {$x4['installments'][0]['amount']} €

{$f(__('Of which financing cost', 'payplug'))}: {$financing_cost_4x} €

{$f(__('TAEG', 'payplug'))}: {$x4['effective_annual_percentage_rate']} %

HTML; } /** * @param $min * @param $max * @return string */ static function footerOneyWithoutFees($min, $max) { $f = function($fn) { return $fn; }; $footer = << {$f(sprintf(esc_html__('payplug_oneyIT_popup-footer', 'payplug'), $min, $max, __("payplug_oneyIT_popup-url", "payplug"), __("payplug_oneyIT-without-fees_popup-footer_pdf", "payplug")))} HTML; return $footer; } /** * @param $min * @param $max * @return string */ static function footerOneyWithFees($min, $max) { $f = function($fn) { return $fn; }; $footer = << {$f(sprintf(esc_html__('payplug_oneyIT_popup-footer', 'payplug'), $min, $max, __("payplug_oneyIT_popup-url", "payplug"), __("payplug_oneyIT_popup-footer_pdf", "payplug")))} HTML; return $footer; } /** * disabled oney popup * @param \Payplug\PayplugWoocommerce\Front\PayplugOney\Country\Oney $oney * @return string */ static function disabledOneyPopup($oney) { return '
' . sprintf( __('The total amount of your order should be between %s€ and %s€ to pay with Oney.', 'payplug'), $oney->get_min_amount(), $oney->get_max_amount()) . '
' . sprintf(__('The payment with Oney is unavailable because you have more than %s items in your cart.', 'payplug'), PayplugGatewayOney3x::ONEY_PRODUCT_QUANTITY_MAXIMUM) . '
'; } /** * header for cart oney * @return string */ static function payWithOney($oney) { $variations = $oney->getVariations(); $html = '
'; $html .= __('OR PAY IN', 'payplug'); if(!empty($variations)){ foreach($variations as $id => $price){ $html .= ''; } } $html .= '
?
'; return $html; } }