{% if craft.app.request.isCpRequest == true %} {% endif %} {% if gateway.insertForm or craft.app.request.isCpRequest %} {% import "_includes/forms" as forms %}
{{ 'Card Holder'|t('commerce') }}
{{ forms.text({ name: 'firstName', maxlength: 70, placeholder: "First Name"|t('commerce'), autocomplete: false, class: 'card-holder-first-name'~(paymentForm.getErrors('firstName') ? ' error'), value: paymentForm.firstName, required: true, autocomplete: "given-name" }) }}
{{ forms.text({ name: 'lastName', maxlength: 70, placeholder: "Last Name"|t('commerce'), autocomplete: false, class: 'card-holder-last-name'~(paymentForm.getErrors('lastName') ? ' error'), value: paymentForm.lastName, required: true, autocomplete: "family-name" }) }}
{% set errors = [] %} {% for attributeKey in ['firstName', 'lastName'] %} {% set errors = errors|merge(paymentForm.getErrors(attributeKey)) %} {% endfor %} {{ forms.errorList(errors) }}
{{ 'Card'|t('commerce') }}
{% if gateway.acceptJS %} {{ forms.text({ name: 'cc-number', maxlength: 19, placeholder: "Card Number"|t('commerce'), autocomplete: false, id: 'cc-number', class: 'card-number'~(paymentForm.getErrors('number') ? ' error'), value: paymentForm.number, autocomplete: "cc-number" }) }} {% else %} {{ forms.text({ name: 'number', maxlength: 19, placeholder: "Card Number"|t('commerce'), autocomplete: false, id: 'number', class: 'card-number'~(paymentForm.getErrors('number') ? ' error'), value: paymentForm.number, autocomplete: "cc-number" }) }} {% endif %}
{{ forms.text({ class: 'card-expiry'~(paymentForm.getErrors('month') ? ' error'), type: 'text', maxlength: 2, id: 'month', name: 'month', placeholder: "MM"|t('commerce'), value: paymentForm.month, autocomplete: "cc-exp-month" }) }} {{ forms.text({ class: 'card-expiry'~(paymentForm.getErrors('year') ? ' error'), type: 'text', maxlength: 4, id: 'year', name: 'year', placeholder: "YYYY"|t('commerce'), value: paymentForm.year, autocomplete: "cc-exp-year" }) }} {{ forms.text({ type: 'text', name: 'cvv', id: 'cvv', placeholder: "CVV"|t('commerce'), class: 'card-cvc'~(paymentForm.getErrors('cvv') ? ' error'), value: paymentForm.cvv, autocomplete: "cc-csc" }) }}
{% set errors = [] %} {% for attributeKey in ['number', 'month', 'year', 'cvv'] %} {% set errors = errors|merge(paymentForm.getErrors(attributeKey)) %} {% endfor %} {{ forms.errorList(errors) }}
{% if gateway.acceptJS %} {% if craft.app.request.isCpRequest == true %} {% endif %} {% if gateway.disableAcceptData and craft.app.request.isCpRequest != true %} {% elseif craft.app.request.isCpRequest != true %} {% endif %} {% else %} {% if craft.app.request.isCpRequest != true %} {% endif %} {% endif %} {% endif %}