<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>

CC BY-SA 4.0
2019-10-29T14:26:32.970Z
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)?
foamcow
CC BY-SA 4.0
2019-10-29T16:18:09.623Z
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.
foamcow
CC BY-SA 4.0
2019-04-16T21:08:37.163Z
2019-04-16T21:08:37.163Z
Luke Holder
<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>

<plugin-craftcommerce2><ecommerce>
How to use Saved Card in Craft Commerce
# 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.

    {% for storedCard in storedCards %}
        {{ storedCard.description }}
    {% endfor %}

> **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.  

---

