var/cache/dev/twig/37/37a5b40c865f46c22a24ce609f19eab1.php line 50

Open in your IDE?
  1. <?php
  2. use Twig\Environment;
  3. use Twig\Error\LoaderError;
  4. use Twig\Error\RuntimeError;
  5. use Twig\Extension\CoreExtension;
  6. use Twig\Extension\SandboxExtension;
  7. use Twig\MacroNamespace;
  8. use Twig\Markup;
  9. use Twig\Sandbox\SecurityError;
  10. use Twig\Sandbox\SecurityNotAllowedTagError;
  11. use Twig\Sandbox\SecurityNotAllowedFilterError;
  12. use Twig\Sandbox\SecurityNotAllowedFunctionError;
  13. use Twig\Sandbox\SecurityNotAllowedTestError;
  14. use Twig\Source;
  15. use Twig\Template;
  16. use Twig\TemplateWrapper;
  17. /* front/tunnel/step3a.html.twig */
  18. class __TwigTemplate_50d4e00c22cbd60ea12fa6a5510aea29 extends Template
  19. {
  20.     private Source $source;
  21.     /**
  22.      * @var array<string, MacroNamespace>
  23.      */
  24.     private array $macros = [];
  25.     private \Twig\Runtime\EscaperRuntime $escaper;
  26.     public function __construct(Environment $env)
  27.     {
  28.         parent::__construct($env);
  29.         $this->source = $this->getSourceContext();
  30.         $this->escaper = $env->getRuntime('Twig\Runtime\EscaperRuntime');
  31.         $this->blocks = [
  32.             'head' => [$this, 'block_head'],
  33.             'body' => [$this, 'block_body'],
  34.             'javascripts' => [$this, 'block_javascripts'],
  35.         ];
  36.     }
  37.     protected function doGetParent(array $context): bool|string|Template|TemplateWrapper
  38.     {
  39.         // line 1
  40.         return $this->parent ??= $this->load("front/tunnel/layout.html.twig", 1);
  41.     }
  42.     protected function doDisplay(array $context, array $blocks = []): iterable
  43.     {
  44.         $macros = $this->macros;
  45.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  46.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/tunnel/step3a.html.twig"));
  47.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  48.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "template", "front/tunnel/step3a.html.twig"));
  49.         $this->parent = $this->load("front/tunnel/layout.html.twig", 1);
  50.         yield from $this->parent->unwrap()->yield($context, array_merge($this->blocks, $blocks));
  51.         
  52.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  53.         
  54.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  55.     }
  56.     // line 2
  57.     /**
  58.      * @return iterable<null|scalar|\Stringable>
  59.      */
  60.     public function block_head(array $context, array $blocks = []): iterable
  61.     {
  62.         $macros = $this->macros;
  63.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  64.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "head"));
  65.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  66.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "head"));
  67.         // line 3
  68.         yield "\t<title>Étape 3</title>
  69. ";
  70.         
  71.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  72.         
  73.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  74.         return; yield;
  75.     }
  76.     // line 5
  77.     /**
  78.      * @return iterable<null|scalar|\Stringable>
  79.      */
  80.     public function block_body(array $context, array $blocks = []): iterable
  81.     {
  82.         $macros = $this->macros;
  83.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  84.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  85.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  86.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "body"));
  87.         // line 6
  88.         yield "
  89. <section class=\"w-full py-10 sm:py-20\">
  90. \t<ol class=\"flex flex-row w-full\">
  91. \t\t<!--first item-->
  92. \t\t<li class=\"relative flex-1\">
  93. \t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
  94. \t\t\t<div class=\"relative z-10 flex flex-col items-center\">
  95. \t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
  96. \t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
  97. \t\t\t\t\t1. Je sélectionne la durée
  98. \t\t\t\t</p>
  99. \t\t\t</div>
  100. \t\t</li>
  101. \t\t<!--Second item-->
  102. \t\t<li class=\"relative flex-1\">
  103. \t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
  104. \t\t\t<div class=\"relative z-10 flex flex-col items-center\">
  105. \t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo border-4 border-bleuindigo\"></div>
  106. \t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
  107. \t\t\t\t\t2. J\x27accède à mon compte
  108. \t\t\t\t</p>
  109. \t\t\t</div>
  110. \t\t</li>
  111. \t\t<!--Third item-->
  112. \t\t<li class=\"relative flex-1\">
  113. \t\t\t<div class=\"relative z-10 flex flex-col items-center\">
  114. \t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
  115. \t\t\t\t<p class=\"mt-4 sm:mt-2 text-sm sm:text-lg font-bold text-bleuindigo text-center px-2\">
  116. \t\t\t\t\t3. Je procède au paiement
  117. \t\t\t\t</p>
  118. \t\t\t</div>
  119. \t\t</li>
  120. \t</ol>
  121. </section>
  122. ";
  123.         // line 45
  124.         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)) {
  125.             // line 46
  126.             yield "<section class=\"flex justify-center mb-8 sm:mb-16\">
  127. \t<div class=\"text-center bg-jaune text-bleuindigo font-bold py-2 px-4 rounded-full text-sm sm:text-lg\">
  128. \t\tVous ne serez pas débité avant la fin de votre essai de 7 jours, résiliable à tout moment.
  129. \t</div>
  130. </section>
  131. ";
  132.         }
  133.         // line 52
  134.         yield "
  135. <!--Informations-->
  136. <section class=\"flex justify-center\">
  137. \t<div class=\"flex flex-col lg:flex-row justify-between\">
  138. \t\t<!--Colonne gauche-->
  139. \t\t<div class=\"flex flex-col lg:w-6/12 xl:w-7/12 gap-10\">
  140. \t\t\t<!--Coordonnées bancaires-->
  141. \t\t\t<div>
  142. \t\t\t\t<span class=\"text-bleuindigo font-bold text-2xl sm:text-3xl\">Coordonnées bancaires</span>
  143. \t\t\t</div>
  144. \t\t\t<!--Widget CB-->
  145. \t\t\t<div class=\"mt-10\">
  146. \t\t\t\t<div id=\"payment-element\">
  147. \t\t\t\t</div>
  148. \t\t\t</div>
  149. \t\t\t<div class=\"flex flex-col items-start text-sm sm:text-base gap-2\">
  150. \t\t\t\t<div>
  151. \t\t\t\t\t<div>
  152. \t\t\t\t\t\t<input id=\"cgu\" name=\"cgu\" type=\"checkbox\"
  153. \t\t\t\t\t\t\t   class=\"size-5 border-lavande rounded-xl\" />
  154. \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>
  155. \t\t\t\t\t</div>
  156. \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>
  157. \t\t\t\t</div>
  158. \t\t\t\t<div>
  159. \t\t\t\t\t<input id=\"offres\" name=\"offres\" type=\"checkbox\"
  160. \t\t\t\t\t\t   class=\"size-5 border-lavande rounded-xl\" />
  161. \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>
  162. \t\t\t\t</div>
  163. \t\t\t</div>
  164. \t\t</div>
  165. \t\t<!--Colonne droite-->
  166. \t\t<div class=\"flex flex-col lg:w-5/12 xl:w-4/12 my-16 lg:mt-0\">
  167. \t\t\t<!--Encadré lavande-->
  168. \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\">
  169. \t\t\t\t<div class=\"text-bleuindigo font-bold text-xl\">
  170. \t\t\t\t\tVous avez choisi l’offre
  171. \t\t\t\t</div>
  172. \t\t\t\t<div class=\"text-pervenche font-bold text-2xl sm:text-3xl\">
  173. \t\t\t\t\t";
  174.         // line 100
  175.         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);
  176.         yield "
  177. \t\t\t\t</div>
  178. \t\t\t\t<div class=\"font-bold mt-2\">
  179. \t\t\t\t\t";
  180.         // line 103
  181.         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);
  182.         yield "
  183. \t\t\t\t</div>
  184.                 <div class=\"flex justify-between items-center mt-4\">
  185.             <span class=\"flex text-bleuindigo font-bold\">
  186.               <span class=\"flex items-center bg-jaune rounded-xl px-2 mr-1\"><span class=\"text-lg -my-1 pr-1\">&#9733</span> 4,6</span>+ 300 avis Trustpilot
  187.             </span>
  188.                     <span class=\"text-pervenche text-xs hover:underline\"><a href=\"https://fr.trustpilot.com/review/lesbonsprofs.com\" target=\"_blank\">Voir les avis</a></span>
  189.                 </div>
  190. \t\t\t\t";
  191.         // line 111
  192.         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)) {
  193.             // line 112
  194.             yield "\t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
  195. \t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
  196. \t\t\t\t\t\t<span>0€</span>
  197. \t\t\t\t\t</div>
  198. \t\t\t\t\t<hr class=\"border-lavande border my-2\" />
  199. \t\t\t\t\t<div class=\"flex justify-between text-bleuindigo\">
  200. \t\t\t\t\t\t<span>Montant dû au ";
  201.             // line 118
  202.             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);
  203.             yield "</span>
  204. \t\t\t\t\t\t<span class=\"font-bold\" id=\"som-toto\">";
  205.             // line 119
  206.             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);
  207.             yield " €</span>
  208. \t\t\t\t\t</div>
  209. \t\t\t\t";
  210.         } else {
  211.             // line 122
  212.             yield "\t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
  213. \t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
  214. \t\t\t\t\t\t<span id=\"som-toto\">";
  215.             // line 124
  216.             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);
  217.             yield " €</span>
  218. \t\t\t\t\t</div>
  219. \t\t\t\t";
  220.         }
  221.         // line 127
  222.         yield "\t\t\t\t";
  223.         if ( !(null === (isset($context["discount"]) || array_key_exists("discount", $context) ? $context["discount"] : (function () { throw new RuntimeError('Variable "discount" does not exist.', 127, $this->source); })()))) {
  224.             // line 128
  225.             yield "\t\t\t\t\t<div class=\"text-bleuindigo mb-2\"><span class=\"font-bold me-1\">Promotion appliquée :</span> ";
  226.             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);
  227.             yield "</div>
  228. \t\t\t\t";
  229.         }
  230.         // line 130
  231.         yield "
  232. \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>
  233. \t\t\t</div>
  234. \t\t</div>
  235. \t</div>
  236. </section>
  237. ";
  238.         
  239.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  240.         
  241.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  242.         return; yield;
  243.     }
  244.     // line 138
  245.     /**
  246.      * @return iterable<null|scalar|\Stringable>
  247.      */
  248.     public function block_javascripts(array $context, array $blocks = []): iterable
  249.     {
  250.         $macros = $this->macros;
  251.         $__internal_5a27a8ba21ca79b61932376b2fa922d2 = $this->extensions["Symfony\\Bundle\\WebProfilerBundle\\Twig\\WebProfilerExtension"];
  252.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->enter($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  253.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f = $this->extensions["Symfony\\Bridge\\Twig\\Extension\\ProfilerExtension"];
  254.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->enter($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof = new \Twig\Profiler\Profile($this->getTemplateName(), "block", "javascripts"));
  255.         // line 139
  256.         yield "\t<script src=\"https://js.stripe.com/v3/\"></script>
  257. \t<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js\"></script>
  258. \t<script type=\"text/javascript\">
  259.         function displayErrorCard(event,target){
  260.             var displayError = document.getElementById(target);
  261.             if (event.error) {
  262.                 displayError.textContent = event.error.message;
  263.                 \$(\x27#\x27+target).show();
  264.             } else {
  265.                 displayError.textContent = \x27\x27;
  266.             }
  267.         }
  268.         function noPaiement3DSecure(elem){
  269.             \$.ajax({
  270.                 url:\"";
  271.         // line 155
  272.         yield (string) $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("remove-3DS-stripe-paiement");
  273.         yield "\",
  274.                 data:elem,
  275.                 method:\x27GET\x27,
  276.                 success:function(msg){
  277.                 }
  278.             })
  279.         }
  280.         \$(document).ready(function(){
  281.             var stripe,cardNumberElement
  282.             stripe = Stripe(\"";
  283.         // line 168
  284.         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);
  285.         yield "\",{
  286.                 locale: \x27fr\x27
  287.             });
  288.             const options = {
  289.                 mode: \x27setup\x27,
  290.                 currency: \x27eur\x27,
  291.                 paymentMethodCreation: \x27manual\x27
  292.             };
  293.             var elements = stripe.elements(options);
  294.             const paymentElement = elements.create(\"payment\");
  295.             paymentElement.mount(\"#payment-element\");
  296.             \$(\x27#cgu\x27).change(function(){
  297.                 if(\$(this).prop(\x27checked\x27)){
  298.                     \$(this).parent().next().addClass(\x27hidden\x27)
  299.                 }
  300.             })
  301.             \$(\x27.btn-validate\x27).click(function(e){
  302.                 e.preventDefault();
  303.                 if(!\$(\x27#cgu\x27).prop(\x27checked\x27)){
  304.                     \$(\x27#cgu\x27).parent().next().removeClass(\x27hidden\x27);
  305.                 }else{
  306.                     // FB Add payment infos tracking
  307.                     \$(\x27.u-spinner\x27).addClass(\x27open\x27);
  308.                     \$(this).hide(\x27slow\x27);
  309.                     var optin = \$(\x27#optin\x27).prop(\x27checked\x27) ? 1 : 0;
  310.                     elements.submit().then(function(submitResult) {
  311.                         if (submitResult.error) {
  312.                             \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  313.                             \$(\x27.btn-validate\x27).show();
  314.                             return;
  315.                         }
  316.                     stripe
  317.                         .createPaymentMethod({
  318.                             elements,
  319.                             params :{
  320.                                 billing_details: {
  321.                                     name: \x27Jenny Rosen\x27,
  322.                                 }},
  323.                         })
  324.                         .then(function(result) {
  325.                             // Handle result.error or result.paymentMethod
  326.                             if(result.paymentMethod){
  327.                                 \$.ajax({
  328.                                     url:\"";
  329.         // line 220
  330.         yield (string) $this->extensions['Symfony\Bridge\Twig\Extension\RoutingExtension']->getPath("setup-subscription-paiement");
  331.         yield "\",
  332.                                     type: \x27POST\x27,
  333.                                     data:\x27pmId=\x27+result.paymentMethod.id,
  334.                                     success:function(elem){
  335.                                         if(elem.success){
  336.                                             var secret = elem.clientSecret;
  337. \t\t\t\t\t\t\t\t\t\t\t";
  338.         // line 226
  339.         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)) {
  340.             // line 227
  341.             yield "                                            stripe.confirmSetup({
  342.                                                 elements,
  343.                                                 clientSecret:secret,
  344.                                                 confirmParams: {
  345.                                                     // Return URL where the customer should be redirected after the SetupIntent is confirmed.
  346.                                                     return_url: \x27";
  347.             // line 232
  348.             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);
  349.             yield "/confirm/subscription/paiement/stripe?free_mode=true&tt_id=\x27+elem.tt+\x27&optin=\x27+optin,
  350.                                                 },
  351.                                             })
  352.                                                 .then(function(result) {
  353.                                                     if (result.error) {
  354.                                                         // Inform the customer that there was an error.
  355.                                                         \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  356.                                                         \$(\x27.btn-validate\x27).show();
  357.                                                         console.log(result.error);
  358.                                                         alert(result.error)
  359.                                                     }else{
  360.                                                     }
  361.                                                 });
  362. \t\t\t\t\t\t\t\t\t\t\t";
  363.         } else {
  364.             // line 249
  365.             yield "                                            if (!secret && elem.payment_id) {
  366.                                                 window.location.href = \x27";
  367.             // line 250
  368.             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);
  369.             yield "/confirm/subscription/paiement/stripe?payment_intent=\x27+elem.payment_id+\x27&redirect_status=succeeded&free_mode=false&tt_id=\x27+elem.tt;
  370.                                             } else {
  371.                                                 stripe.confirmPayment({
  372.                                                     elements,
  373.                                                     clientSecret:secret,
  374.                                                     confirmParams: {
  375.                                                         return_url: \x27";
  376.             // line 256
  377.             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);
  378.             yield "/confirm/subscription/paiement/stripe?free_mode=false&tt_id=\x27+elem.tt,
  379.                                                     },
  380.                                                 })
  381.                                                     .then(function(result) {
  382.                                                         if (result.error) {
  383.                                                             \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  384.                                                             alert(result.error)
  385.                                                             noPaiement3DSecure(elem)
  386.                                                         }
  387.                                                     })
  388.                                                     .error(function(error) {
  389.                                                         \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  390.                                                         alert(error)
  391.                                                     });
  392.                                             }
  393. \t\t\t\t\t\t\t\t\t\t\t";
  394.         }
  395.         // line 272
  396.         yield "
  397.                                         }else{
  398.                                             \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  399.                                             \$(\x27.btn-validate\x27).show();
  400.                                             alert(elem.msg);
  401.                                             console.log(elem.msg)
  402.                                         }
  403.                                     }
  404.                                 })
  405.                             }
  406.                         }).catch(function(error) {
  407.                         \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  408.                         alert(error);
  409.                         console.log(error);
  410.                     });
  411.                     }); // end elements.submit().then
  412.                 }
  413.             })
  414.         })
  415. \t</script>
  416. ";
  417.         
  418.         $__internal_6f47bbe9983af81f1e7450e9a3e3768f->leave($__internal_6f47bbe9983af81f1e7450e9a3e3768f_prof);
  419.         
  420.         $__internal_5a27a8ba21ca79b61932376b2fa922d2->leave($__internal_5a27a8ba21ca79b61932376b2fa922d2_prof);
  421.         return; yield;
  422.     }
  423.     /**
  424.      * @codeCoverageIgnore
  425.      */
  426.     public function getTemplateName(): string
  427.     {
  428.         return "front/tunnel/step3a.html.twig";
  429.     }
  430.     /**
  431.      * @codeCoverageIgnore
  432.      */
  433.     public function isTraitable(): bool
  434.     {
  435.         return false;
  436.     }
  437.     /**
  438.      * @codeCoverageIgnore
  439.      */
  440.     public function getDefaultEscapeStrategy(): string|false
  441.     {
  442.         return "html";
  443.     }
  444.     /**
  445.      * @codeCoverageIgnore
  446.      */
  447.     public function getDebugInfo(): array
  448.     {
  449.         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,);
  450.     }
  451.     public function getSourceContext(): Source
  452.     {
  453.         return new Source("{% extends \x27front/tunnel/layout.html.twig\x27 %}
  454. {% block head %}
  455. \t<title>Étape 3</title>
  456. {% endblock %}
  457. {% block body %}
  458. <section class=\"w-full py-10 sm:py-20\">
  459. \t<ol class=\"flex flex-row w-full\">
  460. \t\t<!--first item-->
  461. \t\t<li class=\"relative flex-1\">
  462. \t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
  463. \t\t\t<div class=\"relative z-10 flex flex-col items-center\">
  464. \t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
  465. \t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
  466. \t\t\t\t\t1. Je sélectionne la durée
  467. \t\t\t\t</p>
  468. \t\t\t</div>
  469. \t\t</li>
  470. \t\t<!--Second item-->
  471. \t\t<li class=\"relative flex-1\">
  472. \t\t\t<div class=\"absolute top-2 left-1/2 w-full h-1.25 bg-bleuindigo\"></div>
  473. \t\t\t<div class=\"relative z-10 flex flex-col items-center\">
  474. \t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo border-4 border-bleuindigo\"></div>
  475. \t\t\t\t<p class=\"mt-4 text-sm font-bold text-bleuindigo text-center px-2\">
  476. \t\t\t\t\t2. J\x27accède à mon compte
  477. \t\t\t\t</p>
  478. \t\t\t</div>
  479. \t\t</li>
  480. \t\t<!--Third item-->
  481. \t\t<li class=\"relative flex-1\">
  482. \t\t\t<div class=\"relative z-10 flex flex-col items-center\">
  483. \t\t\t\t<div class=\"size-5 rounded-full bg-bleuindigo\"></div>
  484. \t\t\t\t<p class=\"mt-4 sm:mt-2 text-sm sm:text-lg font-bold text-bleuindigo text-center px-2\">
  485. \t\t\t\t\t3. Je procède au paiement
  486. \t\t\t\t</p>
  487. \t\t\t</div>
  488. \t\t</li>
  489. \t</ol>
  490. </section>
  491. {% if mode_free %}
  492. <section class=\"flex justify-center mb-8 sm:mb-16\">
  493. \t<div class=\"text-center bg-jaune text-bleuindigo font-bold py-2 px-4 rounded-full text-sm sm:text-lg\">
  494. \t\tVous ne serez pas débité avant la fin de votre essai de 7 jours, résiliable à tout moment.
  495. \t</div>
  496. </section>
  497. {% endif %}
  498. <!--Informations-->
  499. <section class=\"flex justify-center\">
  500. \t<div class=\"flex flex-col lg:flex-row justify-between\">
  501. \t\t<!--Colonne gauche-->
  502. \t\t<div class=\"flex flex-col lg:w-6/12 xl:w-7/12 gap-10\">
  503. \t\t\t<!--Coordonnées bancaires-->
  504. \t\t\t<div>
  505. \t\t\t\t<span class=\"text-bleuindigo font-bold text-2xl sm:text-3xl\">Coordonnées bancaires</span>
  506. \t\t\t</div>
  507. \t\t\t<!--Widget CB-->
  508. \t\t\t<div class=\"mt-10\">
  509. \t\t\t\t<div id=\"payment-element\">
  510. \t\t\t\t</div>
  511. \t\t\t</div>
  512. \t\t\t<div class=\"flex flex-col items-start text-sm sm:text-base gap-2\">
  513. \t\t\t\t<div>
  514. \t\t\t\t\t<div>
  515. \t\t\t\t\t\t<input id=\"cgu\" name=\"cgu\" type=\"checkbox\"
  516. \t\t\t\t\t\t\t   class=\"size-5 border-lavande rounded-xl\" />
  517. \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>
  518. \t\t\t\t\t</div>
  519. \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>
  520. \t\t\t\t</div>
  521. \t\t\t\t<div>
  522. \t\t\t\t\t<input id=\"offres\" name=\"offres\" type=\"checkbox\"
  523. \t\t\t\t\t\t   class=\"size-5 border-lavande rounded-xl\" />
  524. \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>
  525. \t\t\t\t</div>
  526. \t\t\t</div>
  527. \t\t</div>
  528. \t\t<!--Colonne droite-->
  529. \t\t<div class=\"flex flex-col lg:w-5/12 xl:w-4/12 my-16 lg:mt-0\">
  530. \t\t\t<!--Encadré lavande-->
  531. \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\">
  532. \t\t\t\t<div class=\"text-bleuindigo font-bold text-xl\">
  533. \t\t\t\t\tVous avez choisi l’offre
  534. \t\t\t\t</div>
  535. \t\t\t\t<div class=\"text-pervenche font-bold text-2xl sm:text-3xl\">
  536. \t\t\t\t\t{{ offer.title|upper }}
  537. \t\t\t\t</div>
  538. \t\t\t\t<div class=\"font-bold mt-2\">
  539. \t\t\t\t\t{{ offer.typeOffer.textPaid|raw }}
  540. \t\t\t\t</div>
  541.                 <div class=\"flex justify-between items-center mt-4\">
  542.             <span class=\"flex text-bleuindigo font-bold\">
  543.               <span class=\"flex items-center bg-jaune rounded-xl px-2 mr-1\"><span class=\"text-lg -my-1 pr-1\">&#9733</span> 4,6</span>+ 300 avis Trustpilot
  544.             </span>
  545.                     <span class=\"text-pervenche text-xs hover:underline\"><a href=\"https://fr.trustpilot.com/review/lesbonsprofs.com\" target=\"_blank\">Voir les avis</a></span>
  546.                 </div>
  547. \t\t\t\t{% if mode_free %}
  548. \t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
  549. \t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
  550. \t\t\t\t\t\t<span>0€</span>
  551. \t\t\t\t\t</div>
  552. \t\t\t\t\t<hr class=\"border-lavande border my-2\" />
  553. \t\t\t\t\t<div class=\"flex justify-between text-bleuindigo\">
  554. \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>
  555. \t\t\t\t\t\t<span class=\"font-bold\" id=\"som-toto\">{{ amount|number_format(2, \x27,\x27, \x27.\x27) }} €</span>
  556. \t\t\t\t\t</div>
  557. \t\t\t\t{% else %}
  558. \t\t\t\t\t<div class=\"flex justify-between text-franboise font-bold mt-4\">
  559. \t\t\t\t\t\t<span>Montant dû aujourd\x27hui</span>
  560. \t\t\t\t\t\t<span id=\"som-toto\">{{ amount|number_format(2, \x27,\x27, \x27.\x27) }} €</span>
  561. \t\t\t\t\t</div>
  562. \t\t\t\t{% endif %}
  563. \t\t\t\t{% if discount is not null %}
  564. \t\t\t\t\t<div class=\"text-bleuindigo mb-2\"><span class=\"font-bold me-1\">Promotion appliquée :</span> {{ discount.title }}</div>
  565. \t\t\t\t{% endif %}
  566. \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>
  567. \t\t\t</div>
  568. \t\t</div>
  569. \t</div>
  570. </section>
  571. {% endblock %}
  572. {% block javascripts %}
  573. \t<script src=\"https://js.stripe.com/v3/\"></script>
  574. \t<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.7.1/jquery.min.js\"></script>
  575. \t<script type=\"text/javascript\">
  576.         function displayErrorCard(event,target){
  577.             var displayError = document.getElementById(target);
  578.             if (event.error) {
  579.                 displayError.textContent = event.error.message;
  580.                 \$(\x27#\x27+target).show();
  581.             } else {
  582.                 displayError.textContent = \x27\x27;
  583.             }
  584.         }
  585.         function noPaiement3DSecure(elem){
  586.             \$.ajax({
  587.                 url:\"{{ path(\x27remove-3DS-stripe-paiement\x27) }}\",
  588.                 data:elem,
  589.                 method:\x27GET\x27,
  590.                 success:function(msg){
  591.                 }
  592.             })
  593.         }
  594.         \$(document).ready(function(){
  595.             var stripe,cardNumberElement
  596.             stripe = Stripe(\"{{ SPK }}\",{
  597.                 locale: \x27fr\x27
  598.             });
  599.             const options = {
  600.                 mode: \x27setup\x27,
  601.                 currency: \x27eur\x27,
  602.                 paymentMethodCreation: \x27manual\x27
  603.             };
  604.             var elements = stripe.elements(options);
  605.             const paymentElement = elements.create(\"payment\");
  606.             paymentElement.mount(\"#payment-element\");
  607.             \$(\x27#cgu\x27).change(function(){
  608.                 if(\$(this).prop(\x27checked\x27)){
  609.                     \$(this).parent().next().addClass(\x27hidden\x27)
  610.                 }
  611.             })
  612.             \$(\x27.btn-validate\x27).click(function(e){
  613.                 e.preventDefault();
  614.                 if(!\$(\x27#cgu\x27).prop(\x27checked\x27)){
  615.                     \$(\x27#cgu\x27).parent().next().removeClass(\x27hidden\x27);
  616.                 }else{
  617.                     // FB Add payment infos tracking
  618.                     \$(\x27.u-spinner\x27).addClass(\x27open\x27);
  619.                     \$(this).hide(\x27slow\x27);
  620.                     var optin = \$(\x27#optin\x27).prop(\x27checked\x27) ? 1 : 0;
  621.                     elements.submit().then(function(submitResult) {
  622.                         if (submitResult.error) {
  623.                             \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  624.                             \$(\x27.btn-validate\x27).show();
  625.                             return;
  626.                         }
  627.                     stripe
  628.                         .createPaymentMethod({
  629.                             elements,
  630.                             params :{
  631.                                 billing_details: {
  632.                                     name: \x27Jenny Rosen\x27,
  633.                                 }},
  634.                         })
  635.                         .then(function(result) {
  636.                             // Handle result.error or result.paymentMethod
  637.                             if(result.paymentMethod){
  638.                                 \$.ajax({
  639.                                     url:\"{{ path(\x27setup-subscription-paiement\x27) }}\",
  640.                                     type: \x27POST\x27,
  641.                                     data:\x27pmId=\x27+result.paymentMethod.id,
  642.                                     success:function(elem){
  643.                                         if(elem.success){
  644.                                             var secret = elem.clientSecret;
  645. \t\t\t\t\t\t\t\t\t\t\t{% if mode_free %}
  646.                                             stripe.confirmSetup({
  647.                                                 elements,
  648.                                                 clientSecret:secret,
  649.                                                 confirmParams: {
  650.                                                     // Return URL where the customer should be redirected after the SetupIntent is confirmed.
  651.                                                     return_url: \x27{{ app.request.getSchemeAndHttpHost() }}/confirm/subscription/paiement/stripe?free_mode=true&tt_id=\x27+elem.tt+\x27&optin=\x27+optin,
  652.                                                 },
  653.                                             })
  654.                                                 .then(function(result) {
  655.                                                     if (result.error) {
  656.                                                         // Inform the customer that there was an error.
  657.                                                         \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  658.                                                         \$(\x27.btn-validate\x27).show();
  659.                                                         console.log(result.error);
  660.                                                         alert(result.error)
  661.                                                     }else{
  662.                                                     }
  663.                                                 });
  664. \t\t\t\t\t\t\t\t\t\t\t{% else %}
  665.                                             if (!secret && elem.payment_id) {
  666.                                                 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;
  667.                                             } else {
  668.                                                 stripe.confirmPayment({
  669.                                                     elements,
  670.                                                     clientSecret:secret,
  671.                                                     confirmParams: {
  672.                                                         return_url: \x27{{ app.request.getSchemeAndHttpHost() }}/confirm/subscription/paiement/stripe?free_mode=false&tt_id=\x27+elem.tt,
  673.                                                     },
  674.                                                 })
  675.                                                     .then(function(result) {
  676.                                                         if (result.error) {
  677.                                                             \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  678.                                                             alert(result.error)
  679.                                                             noPaiement3DSecure(elem)
  680.                                                         }
  681.                                                     })
  682.                                                     .error(function(error) {
  683.                                                         \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  684.                                                         alert(error)
  685.                                                     });
  686.                                             }
  687. \t\t\t\t\t\t\t\t\t\t\t{% endif %}
  688.                                         }else{
  689.                                             \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  690.                                             \$(\x27.btn-validate\x27).show();
  691.                                             alert(elem.msg);
  692.                                             console.log(elem.msg)
  693.                                         }
  694.                                     }
  695.                                 })
  696.                             }
  697.                         }).catch(function(error) {
  698.                         \$(\x27.u-spinner\x27).removeClass(\x27open\x27);
  699.                         alert(error);
  700.                         console.log(error);
  701.                     });
  702.                     }); // end elements.submit().then
  703.                 }
  704.             })
  705.         })
  706. \t</script>
  707. {% endblock %}
  708. ", "front/tunnel/step3a.html.twig", "/var/www/dashboard/templates/front/tunnel/step3a.html.twig");
  709.     }
  710. }