<?php

/* default/template/extension/payment/iyzico_form.twig */
class __TwigTemplate_0b1f648adc7baaca3aaacc94d0560eb111dda6e1166103a7eab931c0a8f4d9a2 extends Twig_Template
{
    public function __construct(Twig_Environment $env)
    {
        parent::__construct($env);

        $this->parent = false;

        $this->blocks = array(
        );
    }

    protected function doDisplay(array $context, array $blocks = array())
    {
        // line 1
        echo "<style>
.loading{width:40px;height:40px;background-color:#4ec8f1;margin:100px auto;-webkit-animation:sk-rotateplane 1.2s infinite ease-in-out;animation:sk-rotateplane 1.2s infinite ease-in-out}@-webkit-keyframes sk-rotateplane{0%{-webkit-transform:perspective(120px)}50%{-webkit-transform:perspective(120px) rotateY(180deg)}100%{-webkit-transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0) rotateY(0);-webkit-transform:perspective(120px) rotateX(0) rotateY(0)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0)}100%{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.brand{margin:auto}.brand p{color:#16a2c5;text-align:center;margin-top:-100px}
</style>
<div id=\"loadingContainer\">
<div class=\"loading\"></div>
  <div class=\"brand\">
    <p>iyzico</p>
  ";
        // line 8
        if (((isset($context["form_type"]) ? $context["form_type"] : null) == "onepage")) {
            echo " 
    <br>
    <p style=\"margin:40px;font-size:16px;\">Ödeme formu bilgilerinizi doldurup siparişi tamamla butonuna bastığınız zaman aktif olacaktır.</p>
  ";
        }
        // line 11
        echo " 

  </div>
</div>

<div class=\"iyzico_checkout_form_payment\" style=\"display:none;\">
  <div class=\"iyzico-payment-form-wrapper\" id=\"payment\"></div>
  <div id=\"iyzipay-checkout-form\" class=\"";
        // line 18
        echo (isset($context["form_class"]) ? $context["form_class"] : null);
        echo "\"></div>
</div>

<script type=\"text/javascript\">

function getFormTokenCall(checkout) {

    if (typeof iyziInit != 'undefined') {
              delete iyziInit;
          }
    \$.ajax({
        url: 'index.php?route=extension/payment/iyzico/getcheckoutformtoken',
        type: 'post',
        dataType: 'json',
        cache: false,
        success: function(json) {

          if(json != null) {

              if (typeof json.checkoutFormContent != \"undefined\" && json.checkoutFormContent != \"\") { 

                \$(\".iyzico_checkout_form_payment\").show( \"slow\", function() {

                  \$('.iyzico-payment-form-wrapper').append(json.checkoutFormContent);
                  
                  \$(\".iyzico-payment-form-wrapper\").promise().done(function() {
                      \$('#loadingContainer').css('display','none');
                  });

               });

                  if(checkout == 'onepage') {
                      \$(\".checkout-loading\").css(\"opacity\",\"100\");
                      \$(\"#payment-confirm-button\").css(\"pointer-events\",\"visible\");
                      \$('#journal-checkout-confirm-button').css('display','none');
                  }
              } else {

                \$(\".iyzico_checkout_form_payment\").show();
                \$('.iyzico-payment-form-wrapper').append('<div class=\"alert alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>' + json.errorMessage + '</div>');
                \$('#iyzico-loader').css('display','none');
  
              }
          } else {

            \$(\".iyzico_checkout_form_payment\").show();
            \$('.iyzico-payment-form-wrapper').append('<div class=\"alert alert-danger\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>Connection Error</div>');
            \$('#iyzico-loader').css('display','none');
          }
        }
    });

}

function customCheckoutFormTokenCall(checkout) {

  \$(\".confirm-button\").click(function(e) {

      var ajaxData,errors,done = null;

      \$( document ).ajaxComplete(function( event, xhr, settings ) {
      
        ajaxData      = JSON.parse(xhr.responseText);
        errors        = ajaxData.errors;

        if(typeof errors != 'undefined' && errors == null && done == null) {

          done = true;

          return getFormTokenCall(checkout);
        
        }


      });

    e.preventDefault();

  });
}

</script>

";
        // line 101
        if (((isset($context["form_type"]) ? $context["form_type"] : null) != "onepage")) {
            echo " 
<script>
\$(document).ready(function(){
  return getFormTokenCall('default');
});
</script>
";
        } elseif ((        // line 107
(isset($context["form_type"]) ? $context["form_type"] : null) == "onepage")) {
            echo " 
<script type=\"text/javascript\">
  \$(document).ready(function(){
    return customCheckoutFormTokenCall('onepage');
  });
</script>
";
        }
        // line 113
        echo " 
";
    }

    public function getTemplateName()
    {
        return "default/template/extension/payment/iyzico_form.twig";
    }

    public function isTraitable()
    {
        return false;
    }

    public function getDebugInfo()
    {
        return array (  149 => 113,  139 => 107,  130 => 101,  44 => 18,  35 => 11,  28 => 8,  19 => 1,);
    }
}
/* <style>*/
/* .loading{width:40px;height:40px;background-color:#4ec8f1;margin:100px auto;-webkit-animation:sk-rotateplane 1.2s infinite ease-in-out;animation:sk-rotateplane 1.2s infinite ease-in-out}@-webkit-keyframes sk-rotateplane{0%{-webkit-transform:perspective(120px)}50%{-webkit-transform:perspective(120px) rotateY(180deg)}100%{-webkit-transform:perspective(120px) rotateY(180deg) rotateX(180deg)}}@keyframes sk-rotateplane{0%{transform:perspective(120px) rotateX(0) rotateY(0);-webkit-transform:perspective(120px) rotateX(0) rotateY(0)}50%{transform:perspective(120px) rotateX(-180.1deg) rotateY(0);-webkit-transform:perspective(120px) rotateX(-180.1deg) rotateY(0)}100%{transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg);-webkit-transform:perspective(120px) rotateX(-180deg) rotateY(-179.9deg)}}.brand{margin:auto}.brand p{color:#16a2c5;text-align:center;margin-top:-100px}*/
/* </style>*/
/* <div id="loadingContainer">*/
/* <div class="loading"></div>*/
/*   <div class="brand">*/
/*     <p>iyzico</p>*/
/*   {% if form_type == 'onepage' %} */
/*     <br>*/
/*     <p style="margin:40px;font-size:16px;">Ödeme formu bilgilerinizi doldurup siparişi tamamla butonuna bastığınız zaman aktif olacaktır.</p>*/
/*   {% endif %} */
/* */
/*   </div>*/
/* </div>*/
/* */
/* <div class="iyzico_checkout_form_payment" style="display:none;">*/
/*   <div class="iyzico-payment-form-wrapper" id="payment"></div>*/
/*   <div id="iyzipay-checkout-form" class="{{form_class}}"></div>*/
/* </div>*/
/* */
/* <script type="text/javascript">*/
/* */
/* function getFormTokenCall(checkout) {*/
/* */
/*     if (typeof iyziInit != 'undefined') {*/
/*               delete iyziInit;*/
/*           }*/
/*     $.ajax({*/
/*         url: 'index.php?route=extension/payment/iyzico/getcheckoutformtoken',*/
/*         type: 'post',*/
/*         dataType: 'json',*/
/*         cache: false,*/
/*         success: function(json) {*/
/* */
/*           if(json != null) {*/
/* */
/*               if (typeof json.checkoutFormContent != "undefined" && json.checkoutFormContent != "") { */
/* */
/*                 $(".iyzico_checkout_form_payment").show( "slow", function() {*/
/* */
/*                   $('.iyzico-payment-form-wrapper').append(json.checkoutFormContent);*/
/*                   */
/*                   $(".iyzico-payment-form-wrapper").promise().done(function() {*/
/*                       $('#loadingContainer').css('display','none');*/
/*                   });*/
/* */
/*                });*/
/* */
/*                   if(checkout == 'onepage') {*/
/*                       $(".checkout-loading").css("opacity","100");*/
/*                       $("#payment-confirm-button").css("pointer-events","visible");*/
/*                       $('#journal-checkout-confirm-button').css('display','none');*/
/*                   }*/
/*               } else {*/
/* */
/*                 $(".iyzico_checkout_form_payment").show();*/
/*                 $('.iyzico-payment-form-wrapper').append('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>' + json.errorMessage + '</div>');*/
/*                 $('#iyzico-loader').css('display','none');*/
/*   */
/*               }*/
/*           } else {*/
/* */
/*             $(".iyzico_checkout_form_payment").show();*/
/*             $('.iyzico-payment-form-wrapper').append('<div class="alert alert-danger"><button type="button" class="close" data-dismiss="alert">×</button>Connection Error</div>');*/
/*             $('#iyzico-loader').css('display','none');*/
/*           }*/
/*         }*/
/*     });*/
/* */
/* }*/
/* */
/* function customCheckoutFormTokenCall(checkout) {*/
/* */
/*   $(".confirm-button").click(function(e) {*/
/* */
/*       var ajaxData,errors,done = null;*/
/* */
/*       $( document ).ajaxComplete(function( event, xhr, settings ) {*/
/*       */
/*         ajaxData      = JSON.parse(xhr.responseText);*/
/*         errors        = ajaxData.errors;*/
/* */
/*         if(typeof errors != 'undefined' && errors == null && done == null) {*/
/* */
/*           done = true;*/
/* */
/*           return getFormTokenCall(checkout);*/
/*         */
/*         }*/
/* */
/* */
/*       });*/
/* */
/*     e.preventDefault();*/
/* */
/*   });*/
/* }*/
/* */
/* </script>*/
/* */
/* {% if form_type != 'onepage' %} */
/* <script>*/
/* $(document).ready(function(){*/
/*   return getFormTokenCall('default');*/
/* });*/
/* </script>*/
/* {% elseif form_type == 'onepage' %} */
/* <script type="text/javascript">*/
/*   $(document).ready(function(){*/
/*     return customCheckoutFormTokenCall('onepage');*/
/*   });*/
/* </script>*/
/* {% endif %} */
/* */
