My payment page form works just fine with the dummy gateway, but once I change it to use my authorize.net gateway it says that the CSRF token isn't verified. The code below isn't complete, but I figured maybe there is something in this part that is causing it? Any ideas would be great, thanks!

<form class="flex-container flex-center flex-col nav-buttons flex-lg" method="POST">
  {{ getCsrfInput() }}
    <input type="hidden" name="action" value="commerce/payments/pay"/>
    <input type="hidden" name="redirect" value="/store/customer/order?number={number}"/>
    <input type="hidden" name="cancelUrl" value="/store/checkout/payment"/>
    <input type="hidden" name="paymentMethodId" value="1"/>

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

1 Answer 1


Welp... I feel like an idiot. It wouldn't let it through because I didn't set the endpoints found at https://craftcommerce.com/docs/payment-gateways

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.