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(__('PAYMENT', 'payplug'))} {$f(__('WITHOUT FEES', 'payplug'))}

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

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

+2 {$f(__('monthly payment of', 'payplug'))}: {$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']} €

+3 {$f(__('monthly payment of', 'payplug'))}: {$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(__('PAYMENT', 'payplug'))}

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

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

+2 {$f(__('monthly payment of', 'payplug'))}: {$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']} €

+3 {$f(__('monthly payment of', 'payplug'))}: {$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__("Offre de financement sans assurance avec apport obligatoire, réservée aux particuliers et valable pour tout achat de %s€ à %s€. Sous réserve d’acceptation par Oney Bank. Vous disposez d’un délai de 14 jours pour renoncer à votre crédit. Oney Bank - SA au capital de 51286585€ - 34 Avenue de Flandre 59 170 Croix - 546 380 197 RCS Lille Métropole - n° Orias 07023 261 %s . Correspondance : CS 60 006 - 59895 Lille Cedex - %s", "payplug"), $min, $max, __(" www.orias.fr "), __(" www.oney.fr ") ))} HTML; return $footer; } /** * @param $min * @param $max * @return string */ static function footerOneyWithFees($min, $max) { $f = function($fn) { return $fn; }; return << {$f( sprintf( esc_html__("Offre de financement avec apport obligatoire, réservée aux particuliers et valable pour tout achat de %s€ à %s€. Sous réserve d'acceptation par Oney Bank. Vous disposez d'un délai de 14 jours pour renoncer à votre crédit. Oney Bank - SA au capital de 51 286 585€ - 34 Avenue de Flandre 59170 Croix - 546 380 197 RCS Lille Métropole - n° Orias 07 023 261 %s Correspondance : CS 60 006 - 59895 Lille Cedex - %s"), $min, $max, __(" www.orias.fr "), __(" www.oney.fr ") ))} HTML; } /** * 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; } }