{% 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) }}