{% if google_captcha %}
  <div id="g-recaptcha" class="g-recaptcha" data-sitekey="{{ site_key }}">
  </div>
  {% if error_google_captcha %}
    <span class="text-error text-small">{{ error_google_captcha }}</span>
  {% endif %}
  <script>
    $LAB.setOptions({AllowDuplicates:true}).script('https://www.google.com/recaptcha/api.js').wait(function() {
        grecaptcha.render('g-recaptcha', {
        'sitekey' : '{{ site_key }}'
      });
    });
  </script>
{% else %}
  <label class="field field-medium">
    <span class="field-label">{{ text_captcha }}</span>
    <input type="text" class="field-entry {{ (error_captcha) ? 'field-entry-error' : '' }}" name="captcha" id="captcha" value="{{ captcha }}"  placeholder="{{ text_captcha_placeholder }}" {{ (debug == false) ? 'required' : '' }}>
    {% if error_captcha %}
      <span class="text-small text-error visible-block text-margin-x-small">{{ error_captcha }}</span>
    {% endif %}
    <img src="index.php?route=payment/captcha/loadCaptcha" alt="" class="visible-block top-margin-small">
  </label>
  <script>
    $( "#captcha" ).keydown(function(event) {
      if ( event.which == 13 ) {
        event.preventDefault();
      }
    });
  </script>
{% endif %}