Answers.Body: <p>Welp... I feel like an idiot. It wouldn't let it through because I didn't set the endpoints found at <a href="https://craftcommerce.com/docs/payment-gateways" rel="nofollow noreferrer">https://craftcommerce.com/docs/payment-gateways</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-10-14T17:01:09.070Z
Answers.LastActivityDate: 2017-10-14T17:01:09.070Z
Answers.UserDisplayName: Darryl Hardin
Body: <p>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!</p>
  
  <pre><code>&lt;form class="flex-container flex-center flex-col nav-buttons flex-lg" method="POST"&gt;
    {{ getCsrfInput() }}
      &lt;input type="hidden" name="action" value="commerce/payments/pay"/&gt;
      &lt;input type="hidden" name="redirect" value="/store/customer/order?number={number}"/&gt;
      &lt;input type="hidden" name="cancelUrl" value="/store/checkout/payment"/&gt;
      &lt;input type="hidden" name="paymentMethodId" value="1"/&gt;
  
  {% 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),
  } %}
  </code></pre>
  
Tags: <plugin-craftcommerce><payment-methods>
Title: CSRF Token not verified with actual gateway in Craft Commerce
ThreadText: # CSRF Token not verified with actual gateway in Craft Commerce
  
  (Asked by: username_0 on 2017-10-14)
  
  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),
  } %}
  
  ```
  
  **Tags:** plugin-craftcommerce, payment-methods
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-10-14. Score: 2 | Accepted answer
  
  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>
  
  
  ---
  
  