<?php
use Twig\Environment;
use Twig\Error\LoaderError;
use Twig\Error\RuntimeError;
use Twig\Extension\CoreExtension;
use Twig\Extension\SandboxExtension;
use Twig\MacroNamespace;
use Twig\Markup;
use Twig\Sandbox\SecurityError;
use Twig\Sandbox\SecurityNotAllowedTagError;
use Twig\Sandbox\SecurityNotAllowedFilterError;
use Twig\Sandbox\SecurityNotAllowedFunctionError;
use Twig\Sandbox\SecurityNotAllowedTestError;
use Twig\Source;
use Twig\Template;
use Twig\TemplateWrapper;
/* front/tunnel/step3a.html.twig */
class __TwigTemplate_50d4e00c22cbd60ea12fa6a5510aea29 extends Template
{
private Source $source;
/**
* @var array<string, MacroNamespace>
*/
private array $macros = [];
private \Twig\Runtime\EscaperRuntime $escaper;
public function __construct(Environment $env)
{
parent::__construct($env);
$this->source = $this->getSourceContext();
$this->escaper = $env->getRuntime('Twig\Runtime\EscaperRuntime');
$this->blocks = [
'head' => [$this, 'block_head'],
'body' => [$this, 'block_body'],
'javascripts' => [$this, 'block_javascripts'],
];
}
protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
{
// line 1
return $this->parent ??= $this->load("front/tunnel/layout.html.twig", 1);
}
protected function doDisplay(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/tunnel/step3a.html.twig"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/tunnel/step3a.html.twig"));
$this->parent = $this->load("front/tunnel/layout.html.twig", 1);
yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
}
// line 2
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_head(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "head"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "head"));
// line 3
yield "\t<title>Étape 3</title>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield;
}
// line 5
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_body(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
// line 6
yield "
<section class=\"w-full py-10 sm:py-20\">
\t<ol class=\"flex flex-row w-full\">
\t\t<!--first item-->
\t\t<li class=\"relative flex-1\">
\t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
\t\t\t<div class=\"relative z-10 flex flex-col items-center\">
\t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
\t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
\t\t\t\t\t1. Je sélectionne la durée
\t\t\t\t</p>
\t\t\t</div>
\t\t</li>
\t\t<!--Second item-->
\t\t<li class=\"relative flex-1\">
\t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
\t\t\t<div class=\"relative z-10 flex flex-col items-center\">
\t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo border-4 border-bleuindigo\"></div>
\t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
\t\t\t\t\t2. J\x27accède à mon compte
\t\t\t\t</p>
\t\t\t</div>
\t\t</li>
\t\t<!--Third item-->
\t\t<li class=\"relative flex-1\">
\t\t\t<div class=\"relative z-10 flex flex-col items-center\">
\t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
\t\t\t\t<p class=\"mt-4 sm:mt-2 text-sm sm:text-lg font-bold text-bleuindigo text-center px-2\">
\t\t\t\t\t3. Je procède au paiement
\t\t\t\t</p>
\t\t\t</div>
\t\t</li>
\t</ol>
</section>
";
// line 45
if ((($tmp = (isset($context["mode_free"]) || array_key_exists("mode_free", $context) ? $context["mode_free"] : (function () { throw new RuntimeError('Variable "mode_free" does not exist.', 45, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 46
yield "<section class=\"flex justify-center mb-8 sm:mb-16\">
\t<div class=\"text-center bg-jaune text-bleuindigo font-bold py-2 px-4 rounded-full text-sm sm:text-lg\">
\t\tVous ne serez pas débité avant la fin de votre essai de 7 jours, résiliable à tout moment.
\t</div>
</section>
";
}
// line 52
yield "
<!--Informations-->
<section class=\"flex justify-center\">
\t<div class=\"flex flex-col lg:flex-row justify-between\">
\t\t<!--Colonne gauche-->
\t\t<div class=\"flex flex-col lg:w-6/12 xl:w-7/12 gap-10\">
\t\t\t<!--Coordonnées bancaires-->
\t\t\t<div>
\t\t\t\t<span class=\"text-bleuindigo font-bold text-2xl sm:text-3xl\">Coordonnées bancaires</span>
\t\t\t</div>
\t\t\t<!--Widget CB-->
\t\t\t<div class=\"mt-10\">
\t\t\t\t<div id=\"payment-element\">
\t\t\t\t</div>
\t\t\t</div>
\t\t\t<div class=\"flex flex-col items-start text-sm sm:text-base gap-2\">
\t\t\t\t<div>
\t\t\t\t\t<div>
\t\t\t\t\t\t<input id=\"cgu\" name=\"cgu\" type=\"checkbox\"
\t\t\t\t\t\t\t class=\"size-5 border-lavande rounded-xl\" />
\t\t\t\t\t\t<label for=\"cgu\" class=\"-mt-1\">J’ai lu et j’accepte sans réserve les conditions générales d’abonnement et d’utilisation.</label>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"hidden text-framboise text-center\">Veuillez accepter les conditions générales d\x27abonnement et d\x27utilisation</div>
\t\t\t\t</div>
\t\t\t\t<div>
\t\t\t\t\t<input id=\"offres\" name=\"offres\" type=\"checkbox\"
\t\t\t\t\t\t class=\"size-5 border-lavande rounded-xl\" />
\t\t\t\t\t<label for=\"offres\" class=\"-mt-1\">J’accepte de recevoir des conseils et des offres des Bons Profs et de ses partenaires.</label>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t<!--Colonne droite-->
\t\t<div class=\"flex flex-col lg:w-5/12 xl:w-4/12 my-16 lg:mt-0\">
\t\t\t<!--Encadré lavande-->
\t\t\t<div class=\"flex flex-col bg-lavandeclair rounded-2xl text-sm sm:text-base gap-y-2 p-5 sm:p-10\">
\t\t\t\t<div class=\"text-bleuindigo font-bold text-xl\">
\t\t\t\t\tVous avez choisi l’offre
\t\t\t\t</div>
\t\t\t\t<div class=\"text-pervenche font-bold text-2xl sm:text-3xl\">
\t\t\t\t\t";
// line 100
yield (string) $this->escaper->escape(Twig\Extension\CoreExtension::upper($this->env->getCharset(), CoreExtension::getAttribute($this->env, $this->source, (isset($context["offer"]) || array_key_exists("offer", $context) ? $context["offer"] : (function () { throw new RuntimeError('Variable "offer" does not exist.', 100, $this->source); })()), "title", [], "any", false, false, false, 100)), "html", null, true);
yield "
\t\t\t\t</div>
\t\t\t\t<div class=\"font-bold mt-2\">
\t\t\t\t\t";
// line 103
yield (string) CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["offer"]) || array_key_exists("offer", $context) ? $context["offer"] : (function () { throw new RuntimeError('Variable "offer" does not exist.', 103, $this->source); })()), "typeOffer", [], "any", false, false, false, 103), "textPaid", [], "any", false, false, false, 103);
yield "
\t\t\t\t</div>
<div class=\"flex justify-between items-center mt-4\">
<span class=\"flex text-bleuindigo font-bold\">
<span class=\"flex items-center bg-jaune rounded-xl px-2 mr-1\"><span class=\"text-lg -my-1 pr-1\">★</span> 4,6</span>+ 300 avis Trustpilot
</span>
<span class=\"text-pervenche text-xs hover:underline\"><a href=\"https://fr.trustpilot.com/review/lesbonsprofs.com\" target=\"_blank\">Voir les avis</a></span>
</div>
\t\t\t\t";
// line 111
if ((($tmp = (isset($context["mode_free"]) || array_key_exists("mode_free", $context) ? $context["mode_free"] : (function () { throw new RuntimeError('Variable "mode_free" does not exist.', 111, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 112
yield "\t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
\t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
\t\t\t\t\t\t<span>0€</span>
\t\t\t\t\t</div>
\t\t\t\t\t<hr class=\"border-lavande border my-2\" />
\t\t\t\t\t<div class=\"flex justify-between text-bleuindigo\">
\t\t\t\t\t\t<span>Montant dû au ";
// line 118
yield (string) $this->escaper->escape($this->extensions['Twig\Extra\Intl\IntlExtension']->formatDateTime($this->env, $this->extensions['Twig\Extension\CoreExtension']->modifyDate((isset($context["dateAchat"]) || array_key_exists("dateAchat", $context) ? $context["dateAchat"] : (function () { throw new RuntimeError('Variable "dateAchat" does not exist.', 118, $this->source); })()), "+8 day"), null, null, "dd MMMM YYYY", null, null, "fr"), "html", null, true);
yield "</span>
\t\t\t\t\t\t<span class=\"font-bold\" id=\"som-toto\">";
// line 119
yield (string) $this->escaper->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["amount"]) || array_key_exists("amount", $context) ? $context["amount"] : (function () { throw new RuntimeError('Variable "amount" does not exist.', 119, $this->source); })()), 2, ",", "."), "html", null, true);
yield " €</span>
\t\t\t\t\t</div>
\t\t\t\t";
} else {
// line 122
yield "\t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
\t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
\t\t\t\t\t\t<span id=\"som-toto\">";
// line 124
yield (string) $this->escaper->escape($this->extensions['Twig\Extension\CoreExtension']->formatNumber((isset($context["amount"]) || array_key_exists("amount", $context) ? $context["amount"] : (function () { throw new RuntimeError('Variable "amount" does not exist.', 124, $this->source); })()), 2, ",", "."), "html", null, true);
yield " €</span>
\t\t\t\t\t</div>
\t\t\t\t";
}
// line 127
yield "\t\t\t\t";
if ( !(null === (isset($context["discount"]) || array_key_exists("discount", $context) ? $context["discount"] : (function () { throw new RuntimeError('Variable "discount" does not exist.', 127, $this->source); })()))) {
// line 128
yield "\t\t\t\t\t<div class=\"text-bleuindigo mb-2\"><span class=\"font-bold me-1\">Promotion appliquée :</span> ";
yield (string) $this->escaper->escape(CoreExtension::getAttribute($this->env, $this->source, (isset($context["discount"]) || array_key_exists("discount", $context) ? $context["discount"] : (function () { throw new RuntimeError('Variable "discount" does not exist.', 128, $this->source); })()), "title", [], "any", false, false, false, 128), "html", null, true);
yield "</div>
\t\t\t\t";
}
// line 130
yield "
\t\t\t\t<button type=\"submit\" class=\"bg-framboise hover:bg-bleuindigo hover:cursor-pointer text-white rounded-3xl font-bold py-3 mt-4 btn-validate\">Payer</button>
\t\t\t</div>
\t\t</div>
\t</div>
</section>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield;
}
// line 138
/**
* @return iterable<null|scalar|\Stringable>
*/
public function block_javascripts(array $context, array $blocks = []): iterable
{
$macros = $this->macros;
$__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
$__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
$__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
// line 139
yield "\t<script src=\"https://js.stripe.com/v3/\"></script>
\t<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js\"></script>
\t<script type=\"text/javascript\">
function displayErrorCard(event,target){
var displayError = document.getElementById(target);
if (event.error) {
displayError.textContent = event.error.message;
\$(\x27#\x27+target).show();
} else {
displayError.textContent = \x27\x27;
}
}
function noPaiement3DSecure(elem){
\$.ajax({
url:\"";
// line 155
yield (string) $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("remove-3DS-stripe-paiement");
yield "\",
data:elem,
method:\x27GET\x27,
success:function(msg){
}
})
}
\$(document).ready(function(){
var stripe,cardNumberElement
stripe = Stripe(\"";
// line 168
yield (string) $this->escaper->escape((isset($context["SPK"]) || array_key_exists("SPK", $context) ? $context["SPK"] : (function () { throw new RuntimeError('Variable "SPK" does not exist.', 168, $this->source); })()), "html", null, true);
yield "\",{
locale: \x27fr\x27
});
const options = {
mode: \x27setup\x27,
currency: \x27eur\x27,
paymentMethodCreation: \x27manual\x27
};
var elements = stripe.elements(options);
const paymentElement = elements.create(\"payment\");
paymentElement.mount(\"#payment-element\");
\$(\x27#cgu\x27).change(function(){
if(\$(this).prop(\x27checked\x27)){
\$(this).parent().next().addClass(\x27hidden\x27)
}
})
\$(\x27.btn-validate\x27).click(function(e){
e.preventDefault();
if(!\$(\x27#cgu\x27).prop(\x27checked\x27)){
\$(\x27#cgu\x27).parent().next().removeClass(\x27hidden\x27);
}else{
// FB Add payment infos tracking
\$(\x27.u-spinner\x27).addClass(\x27open\x27);
\$(this).hide(\x27slow\x27);
var optin = \$(\x27#optin\x27).prop(\x27checked\x27) ? 1 : 0;
elements.submit().then(function(submitResult) {
if (submitResult.error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
\$(\x27.btn-validate\x27).show();
return;
}
stripe
.createPaymentMethod({
elements,
params :{
billing_details: {
name: \x27Jenny Rosen\x27,
}},
})
.then(function(result) {
// Handle result.error or result.paymentMethod
if(result.paymentMethod){
\$.ajax({
url:\"";
// line 220
yield (string) $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("setup-subscription-paiement");
yield "\",
type: \x27POST\x27,
data:\x27pmId=\x27+result.paymentMethod.id,
success:function(elem){
if(elem.success){
var secret = elem.clientSecret;
\t\t\t\t\t\t\t\t\t\t\t";
// line 226
if ((($tmp = (isset($context["mode_free"]) || array_key_exists("mode_free", $context) ? $context["mode_free"] : (function () { throw new RuntimeError('Variable "mode_free" does not exist.', 226, $this->source); })())) && $tmp instanceof Markup ? (string) $tmp : $tmp)) {
// line 227
yield " stripe.confirmSetup({
elements,
clientSecret:secret,
confirmParams: {
// Return URL where the customer should be redirected after the SetupIntent is confirmed.
return_url: \x27";
// line 232
yield (string) $this->escaper->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 232, $this->source); })()), "request", [], "any", false, false, false, 232), "getSchemeAndHttpHost", [], "method", false, false, false, 232), "html", null, true);
yield "/confirm/subscription/paiement/stripe?free_mode=true&tt_id=\x27+elem.tt+\x27&optin=\x27+optin,
},
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
\$(\x27.btn-validate\x27).show();
console.log(result.error);
alert(result.error)
}else{
}
});
\t\t\t\t\t\t\t\t\t\t\t";
} else {
// line 249
yield " if (!secret && elem.payment_id) {
window.location.href = \x27";
// line 250
yield (string) $this->escaper->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 250, $this->source); })()), "request", [], "any", false, false, false, 250), "getSchemeAndHttpHost", [], "method", false, false, false, 250), "html", null, true);
yield "/confirm/subscription/paiement/stripe?payment_intent=\x27+elem.payment_id+\x27&redirect_status=succeeded&free_mode=false&tt_id=\x27+elem.tt;
} else {
stripe.confirmPayment({
elements,
clientSecret:secret,
confirmParams: {
return_url: \x27";
// line 256
yield (string) $this->escaper->escape(CoreExtension::getAttribute($this->env, $this->source, CoreExtension::getAttribute($this->env, $this->source, (isset($context["app"]) || array_key_exists("app", $context) ? $context["app"] : (function () { throw new RuntimeError('Variable "app" does not exist.', 256, $this->source); })()), "request", [], "any", false, false, false, 256), "getSchemeAndHttpHost", [], "method", false, false, false, 256), "html", null, true);
yield "/confirm/subscription/paiement/stripe?free_mode=false&tt_id=\x27+elem.tt,
},
})
.then(function(result) {
if (result.error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
alert(result.error)
noPaiement3DSecure(elem)
}
})
.error(function(error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
alert(error)
});
}
\t\t\t\t\t\t\t\t\t\t\t";
}
// line 272
yield "
}else{
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
\$(\x27.btn-validate\x27).show();
alert(elem.msg);
console.log(elem.msg)
}
}
})
}
}).catch(function(error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
alert(error);
console.log(error);
});
}); // end elements.submit().then
}
})
})
\t</script>
";
$__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
$__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
return; yield;
}
/**
* @codeCoverageIgnore
*/
public function getTemplateName(): string
{
return "front/tunnel/step3a.html.twig";
}
/**
* @codeCoverageIgnore
*/
public function isTraitable(): bool
{
return false;
}
/**
* @codeCoverageIgnore
*/
public function getDefaultEscapeStrategy(): string|false
{
return "html";
}
/**
* @codeCoverageIgnore
*/
public function getDebugInfo(): array
{
return array ( 454 => 272, 435 => 256, 426 => 250, 423 => 249, 403 => 232, 396 => 227, 394 => 226, 385 => 220, 330 => 168, 314 => 155, 296 => 139, 283 => 138, 265 => 130, 259 => 128, 256 => 127, 250 => 124, 246 => 122, 240 => 119, 236 => 118, 228 => 112, 226 => 111, 215 => 103, 209 => 100, 159 => 52, 151 => 46, 149 => 45, 108 => 6, 95 => 5, 83 => 3, 70 => 2, 47 => 1,);
}
public function getSourceContext(): Source
{
return new Source("{% extends \x27front/tunnel/layout.html.twig\x27 %}
{% block head %}
\t<title>Étape 3</title>
{% endblock %}
{% block body %}
<section class=\"w-full py-10 sm:py-20\">
\t<ol class=\"flex flex-row w-full\">
\t\t<!--first item-->
\t\t<li class=\"relative flex-1\">
\t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
\t\t\t<div class=\"relative z-10 flex flex-col items-center\">
\t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
\t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
\t\t\t\t\t1. Je sélectionne la durée
\t\t\t\t</p>
\t\t\t</div>
\t\t</li>
\t\t<!--Second item-->
\t\t<li class=\"relative flex-1\">
\t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
\t\t\t<div class=\"relative z-10 flex flex-col items-center\">
\t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo border-4 border-bleuindigo\"></div>
\t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
\t\t\t\t\t2. J\x27accède à mon compte
\t\t\t\t</p>
\t\t\t</div>
\t\t</li>
\t\t<!--Third item-->
\t\t<li class=\"relative flex-1\">
\t\t\t<div class=\"relative z-10 flex flex-col items-center\">
\t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
\t\t\t\t<p class=\"mt-4 sm:mt-2 text-sm sm:text-lg font-bold text-bleuindigo text-center px-2\">
\t\t\t\t\t3. Je procède au paiement
\t\t\t\t</p>
\t\t\t</div>
\t\t</li>
\t</ol>
</section>
{% if mode_free %}
<section class=\"flex justify-center mb-8 sm:mb-16\">
\t<div class=\"text-center bg-jaune text-bleuindigo font-bold py-2 px-4 rounded-full text-sm sm:text-lg\">
\t\tVous ne serez pas débité avant la fin de votre essai de 7 jours, résiliable à tout moment.
\t</div>
</section>
{% endif %}
<!--Informations-->
<section class=\"flex justify-center\">
\t<div class=\"flex flex-col lg:flex-row justify-between\">
\t\t<!--Colonne gauche-->
\t\t<div class=\"flex flex-col lg:w-6/12 xl:w-7/12 gap-10\">
\t\t\t<!--Coordonnées bancaires-->
\t\t\t<div>
\t\t\t\t<span class=\"text-bleuindigo font-bold text-2xl sm:text-3xl\">Coordonnées bancaires</span>
\t\t\t</div>
\t\t\t<!--Widget CB-->
\t\t\t<div class=\"mt-10\">
\t\t\t\t<div id=\"payment-element\">
\t\t\t\t</div>
\t\t\t</div>
\t\t\t<div class=\"flex flex-col items-start text-sm sm:text-base gap-2\">
\t\t\t\t<div>
\t\t\t\t\t<div>
\t\t\t\t\t\t<input id=\"cgu\" name=\"cgu\" type=\"checkbox\"
\t\t\t\t\t\t\t class=\"size-5 border-lavande rounded-xl\" />
\t\t\t\t\t\t<label for=\"cgu\" class=\"-mt-1\">J’ai lu et j’accepte sans réserve les conditions générales d’abonnement et d’utilisation.</label>
\t\t\t\t\t</div>
\t\t\t\t\t<div class=\"hidden text-framboise text-center\">Veuillez accepter les conditions générales d\x27abonnement et d\x27utilisation</div>
\t\t\t\t</div>
\t\t\t\t<div>
\t\t\t\t\t<input id=\"offres\" name=\"offres\" type=\"checkbox\"
\t\t\t\t\t\t class=\"size-5 border-lavande rounded-xl\" />
\t\t\t\t\t<label for=\"offres\" class=\"-mt-1\">J’accepte de recevoir des conseils et des offres des Bons Profs et de ses partenaires.</label>
\t\t\t\t</div>
\t\t\t</div>
\t\t</div>
\t\t<!--Colonne droite-->
\t\t<div class=\"flex flex-col lg:w-5/12 xl:w-4/12 my-16 lg:mt-0\">
\t\t\t<!--Encadré lavande-->
\t\t\t<div class=\"flex flex-col bg-lavandeclair rounded-2xl text-sm sm:text-base gap-y-2 p-5 sm:p-10\">
\t\t\t\t<div class=\"text-bleuindigo font-bold text-xl\">
\t\t\t\t\tVous avez choisi l’offre
\t\t\t\t</div>
\t\t\t\t<div class=\"text-pervenche font-bold text-2xl sm:text-3xl\">
\t\t\t\t\t{{ offer.title|upper }}
\t\t\t\t</div>
\t\t\t\t<div class=\"font-bold mt-2\">
\t\t\t\t\t{{ offer.typeOffer.textPaid|raw }}
\t\t\t\t</div>
<div class=\"flex justify-between items-center mt-4\">
<span class=\"flex text-bleuindigo font-bold\">
<span class=\"flex items-center bg-jaune rounded-xl px-2 mr-1\"><span class=\"text-lg -my-1 pr-1\">★</span> 4,6</span>+ 300 avis Trustpilot
</span>
<span class=\"text-pervenche text-xs hover:underline\"><a href=\"https://fr.trustpilot.com/review/lesbonsprofs.com\" target=\"_blank\">Voir les avis</a></span>
</div>
\t\t\t\t{% if mode_free %}
\t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
\t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
\t\t\t\t\t\t<span>0€</span>
\t\t\t\t\t</div>
\t\t\t\t\t<hr class=\"border-lavande border my-2\" />
\t\t\t\t\t<div class=\"flex justify-between text-bleuindigo\">
\t\t\t\t\t\t<span>Montant dû au {{ dateAchat|date_modify(\"+8 day\")|format_datetime(locale=\x27fr\x27,pattern=\"dd MMMM YYYY\") }}</span>
\t\t\t\t\t\t<span class=\"font-bold\" id=\"som-toto\">{{ amount|number_format(2, \x27,\x27, \x27.\x27) }} €</span>
\t\t\t\t\t</div>
\t\t\t\t{% else %}
\t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
\t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
\t\t\t\t\t\t<span id=\"som-toto\">{{ amount|number_format(2, \x27,\x27, \x27.\x27) }} €</span>
\t\t\t\t\t</div>
\t\t\t\t{% endif %}
\t\t\t\t{% if discount is not null %}
\t\t\t\t\t<div class=\"text-bleuindigo mb-2\"><span class=\"font-bold me-1\">Promotion appliquée :</span> {{ discount.title }}</div>
\t\t\t\t{% endif %}
\t\t\t\t<button type=\"submit\" class=\"bg-framboise hover:bg-bleuindigo hover:cursor-pointer text-white rounded-3xl font-bold py-3 mt-4 btn-validate\">Payer</button>
\t\t\t</div>
\t\t</div>
\t</div>
</section>
{% endblock %}
{% block javascripts %}
\t<script src=\"https://js.stripe.com/v3/\"></script>
\t<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js\"></script>
\t<script type=\"text/javascript\">
function displayErrorCard(event,target){
var displayError = document.getElementById(target);
if (event.error) {
displayError.textContent = event.error.message;
\$(\x27#\x27+target).show();
} else {
displayError.textContent = \x27\x27;
}
}
function noPaiement3DSecure(elem){
\$.ajax({
url:\"{{ path(\x27remove-3DS-stripe-paiement\x27) }}\",
data:elem,
method:\x27GET\x27,
success:function(msg){
}
})
}
\$(document).ready(function(){
var stripe,cardNumberElement
stripe = Stripe(\"{{ SPK }}\",{
locale: \x27fr\x27
});
const options = {
mode: \x27setup\x27,
currency: \x27eur\x27,
paymentMethodCreation: \x27manual\x27
};
var elements = stripe.elements(options);
const paymentElement = elements.create(\"payment\");
paymentElement.mount(\"#payment-element\");
\$(\x27#cgu\x27).change(function(){
if(\$(this).prop(\x27checked\x27)){
\$(this).parent().next().addClass(\x27hidden\x27)
}
})
\$(\x27.btn-validate\x27).click(function(e){
e.preventDefault();
if(!\$(\x27#cgu\x27).prop(\x27checked\x27)){
\$(\x27#cgu\x27).parent().next().removeClass(\x27hidden\x27);
}else{
// FB Add payment infos tracking
\$(\x27.u-spinner\x27).addClass(\x27open\x27);
\$(this).hide(\x27slow\x27);
var optin = \$(\x27#optin\x27).prop(\x27checked\x27) ? 1 : 0;
elements.submit().then(function(submitResult) {
if (submitResult.error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
\$(\x27.btn-validate\x27).show();
return;
}
stripe
.createPaymentMethod({
elements,
params :{
billing_details: {
name: \x27Jenny Rosen\x27,
}},
})
.then(function(result) {
// Handle result.error or result.paymentMethod
if(result.paymentMethod){
\$.ajax({
url:\"{{ path(\x27setup-subscription-paiement\x27) }}\",
type: \x27POST\x27,
data:\x27pmId=\x27+result.paymentMethod.id,
success:function(elem){
if(elem.success){
var secret = elem.clientSecret;
\t\t\t\t\t\t\t\t\t\t\t{% if mode_free %}
stripe.confirmSetup({
elements,
clientSecret:secret,
confirmParams: {
// Return URL where the customer should be redirected after the SetupIntent is confirmed.
return_url: \x27{{ app.request.getSchemeAndHttpHost() }}/confirm/subscription/paiement/stripe?free_mode=true&tt_id=\x27+elem.tt+\x27&optin=\x27+optin,
},
})
.then(function(result) {
if (result.error) {
// Inform the customer that there was an error.
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
\$(\x27.btn-validate\x27).show();
console.log(result.error);
alert(result.error)
}else{
}
});
\t\t\t\t\t\t\t\t\t\t\t{% else %}
if (!secret && elem.payment_id) {
window.location.href = \x27{{ app.request.getSchemeAndHttpHost() }}/confirm/subscription/paiement/stripe?payment_intent=\x27+elem.payment_id+\x27&redirect_status=succeeded&free_mode=false&tt_id=\x27+elem.tt;
} else {
stripe.confirmPayment({
elements,
clientSecret:secret,
confirmParams: {
return_url: \x27{{ app.request.getSchemeAndHttpHost() }}/confirm/subscription/paiement/stripe?free_mode=false&tt_id=\x27+elem.tt,
},
})
.then(function(result) {
if (result.error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
alert(result.error)
noPaiement3DSecure(elem)
}
})
.error(function(error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
alert(error)
});
}
\t\t\t\t\t\t\t\t\t\t\t{% endif %}
}else{
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
\$(\x27.btn-validate\x27).show();
alert(elem.msg);
console.log(elem.msg)
}
}
})
}
}).catch(function(error) {
\$(\x27.u-spinner\x27).removeClass(\x27open\x27);
alert(error);
console.log(error);
});
}); // end elements.submit().then
}
})
})
\t</script>
{% endblock %}
", "front/tunnel/step3a.html.twig", "/var/www/dashboard/templates/front/tunnel/step3a.html.twig");
}
}