Answers.Body: <p>You can submit a <code>paymentSourceId</code> to the payments/pay controller action.</p>
  
  <pre><code>&lt;select id="paymentSourceId" name="paymentSourceId"&gt;
      {% for storedCard in storedCards %}
          &lt;option value="{{ storedCard.id }}" {% if storedCard.id == cart.paymentSourceId %}selected{% endif %}&gt;{{ storedCard.description }}&lt;/option&gt;
      {% endfor %}
  &lt;/select&gt;
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T14:26:32.970Z
Answers.Text: This doesn't really answer the original question. It shows how to output a list of saved cards but not how to actually submit and use them as a payment source. How does one submit this without Stripe trying to validate any card input fields on the same form (which would be a common scenario)?
Answers.UserDisplayName: foamcow
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T16:18:09.623Z
Answers.Text: The key element is, of course, the first line of the answer. The payment source submits to a different controller to the actual payment.
  In short, separate forms are needed to switch payment methods and making an actual payment.
Answers.UserDisplayName: foamcow
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-04-16T21:08:37.163Z
Answers.LastActivityDate: 2019-04-16T21:08:37.163Z
Answers.UserDisplayName: Luke Holder
Body: <p>I was able to save cards by using <code>savePaymentSource</code> parameter in my payment form submitting at <code>commerce/payments/pay</code>. But how do I use these saved cards for making payments? I am using Stripe payment method and rendering the form through <code>{{ cart.gateway.getPaymentFormHtml({})|raw }}</code>.</p>
  
Tags: <plugin-craftcommerce2><ecommerce>
Title: How to use Saved Card in Craft Commerce
ThreadText: # How to use Saved Card in Craft Commerce
  
  (Asked by: username_0 on 2019-04-16)
  
  I was able to save cards by using `savePaymentSource` parameter in my payment form submitting at `commerce/payments/pay`. But how do I use these saved cards for making payments? I am using Stripe payment method and rendering the form through `{{ cart.gateway.getPaymentFormHtml({})|raw }}`.
  
  **Tags:** plugin-craftcommerce2, ecommerce
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-04-16. Score: 1
  
  You can submit a `paymentSourceId` to the payments/pay controller action.
  
  ```
  <select id="paymentSourceId" name="paymentSourceId">
      {% for storedCard in storedCards %}
          <option value="{{ storedCard.id }}" {% if storedCard.id == cart.paymentSourceId %}selected{% endif %}>{{ storedCard.description }}</option>
      {% endfor %}
  </select>
  
  ```
  
  > **Comments:**
  > **username_2**: This doesn't really answer the original question. It shows how to output a list of saved cards but not how to actually submit and use them as a payment source. How does one submit this without Stripe trying to validate any card input fields on the same form (which would be a common scenario)?  
  > **username_2**: The key element is, of course, the first line of the answer. The payment source submits to a different controller to the actual payment. In short, separate forms are needed to switch payment methods and making an actual payment.  
  
  ---
  
  