{% extends 'shop/_layouts/checkout' %} {% block content %}

Payment

{# Using the update cart action you could allow the user to select the payment method here. We recommend using ajax to set this, so no page refresh is needed. This would also allow you to dynamically show or hide the credit card form on method change. #} {% if not craft.commerce.paymentMethods|length %}

No payment methods available.

{% endif %} {% if craft.commerce.paymentMethods|length %}
{{ getCsrfInput() }} {% set currencies = craft.commerce.paymentCurrencies %} {% if currencies|length > 1 %} {% endif %}
{% endif %} {% if cart.paymentMethodId %}
{{ getCsrfInput() }}
{% if cart.paymentMethod.class == 'Stripe' %} {% endif %} {% if cart.paymentMethod.class != 'Stripe' %}
{% if cart.paymentMethod.requiresCard() %} {% set currentYear = date()|date_modify("+1 year").format('Y') %} {% set formValues = { firstName: paymentForm is defined ? paymentForm.firstName : (cart.billingAddress ? cart.billingAddress.firstName : ''), lastName: paymentForm is defined ? paymentForm.lastName : (cart.billingAddress ? cart.billingAddress.lastName : ''), number: paymentForm is defined ? paymentForm.number : '', cvv: paymentForm is defined ? paymentForm.cvv : '', month: paymentForm is defined ? paymentForm.month : 1, year: paymentForm is defined ? paymentForm.year : currentYear, } %}
{% if paymentForm is defined %}{{ paymentForm.getError('firstName') }}{% endif %} {% if paymentForm is defined %}{{ paymentForm.getError('lastName') }}{% endif %}
{% if paymentForm is defined %}{{ paymentForm.getError('number') }}{% endif %}
/ {% if paymentForm is defined %}{{ paymentForm.getError('month') }}{% endif %} {% if paymentForm is defined %}{{ paymentForm.getError('year') }}{% endif %}
{% if paymentForm is defined %}{{ paymentForm.getError('cvv') }}{% endif %}
{% endif %}
{% endif %}
{% endif %}
{% includejs %} $('#paymentMethodId , #paymentCurrency').change(function(){ $('form#paymentMethod').submit(); }); {% endincludejs %} {% endblock %}