<p>Finally I get it working. Be sure the payment methods you want to use are activated in the Stripe dashboard. Also be sure Stripe is added to the gateways in the CMS <code>/admin/commerce/settings/gateways</code>. Also be sure if you want to use subscriptions to add them in the CMS <code>admin/commerce/store-settings/subscription-plans</code> here.</p>
<p>With versions:</p>
<pre><code>&quot;craftcms/commerce-stripe&quot;: &quot;4.1.2.1&quot;, 
&quot;craftcms/commerce&quot;: &quot;4.3.3&quot;,
&quot;craftcms/cms&quot;: &quot;4.4.16.1&quot;
</code></pre>
<p>Also be sure using the right stripe settings in your env:</p>
<pre><code>STRIPE_PUBLIC_KEY=&quot;&quot;
STRIPE_API_KEY=&quot;&quot;
STRIPE_WEBHOOK_SECRET=&quot;&quot;
STRIPE_WEBHOOK_SECRET_TWO=&quot;&quot;
STRIPE_PRICE_ID=&quot;&quot;
DUMMY_PAYMENT=&quot;&quot;
</code></pre>
<p>Example form for elements:</p>
<pre class="lang-none prettyprint-override"><code>{% set plans = craft.commerce.getPlans().getAllEnabledPlans() %}
{% set plan = plans|first %}

&lt;form method=&quot;post&quot; class=&quot;form&quot;&gt;
    {{ csrfInput() }}
    {{ actionInput('commerce/payment-sources/add') }}
    {{ hiddenInput('gatewayId', plan.gateway.id) }}
    {{ hiddenInput('successMessage', 'Payment source added.') }}
    {{ hiddenInput('cancelUrl', 'account/pay'|hash) }}
    {{ hiddenInput('isPrimaryPaymentSource', 1) }}

    {% namespace plan.gateway.handle|commercePaymentFormNamespace %}
        {{ plan.gateway.getPaymentFormHtml({
        paymentFormType: 'elements',
        appearance: {
            theme: 'stripe'
        },
        elementOptions: {
            layout: {
                type: 'tabs',
                defaultCollapsed: false,
                radios: false,
                spacedAccordionItems: false
            },
            paymentMethodOrder: ['sepa_debit','card'],
        },
        submitButtonClasses: 'button',
        submitButtonText: 'Save payment method',
        })|raw }}
    {% endnamespace %}
&lt;/form&gt;
</code></pre>

CC BY-SA 4.0
2024-10-07T18:17:45.937Z
2024-10-07T18:17:45.937Z
Maarten Heideman
<p>Also experiencing the same issue. Did you found a solution for this?</p>
<p>Running Craft Pro 4.12.4 and Stripe for Craft Commerce  4.1.5.</p>

CC BY-SA 4.0
2024-10-05T14:20:20.983Z
Yes I switched to stripe elements the way described here:  https://github.com/craftcms/commerce-stripe?tab=readme-ov-file#payment-forms
Maarten Heideman
CC BY-SA 4.0
2024-10-06T16:51:03.587Z
Hm, I tried that too, but even with the current example templates supplied by CraftCMS I am getting the same error after selecting iDEAL in the payment form, as soon as it it is returned from Stripe. Do you mind sharing some of the code you use in this payment flow? Thanks in advance!
Arjan
CC BY-SA 4.0
2024-10-08T10:52:50.170Z
I hope that my answer can help you further
Maarten Heideman
CC BY-SA 4.0
2024-10-04T13:58:13.890Z
2024-10-04T13:58:13.890Z
Arjan
<p>I working on a craft commerce project with subscriptions. I have problems with saving a paymentsource of the type &quot;ideal&quot; and &quot;bancontact&quot; with stripe. Creditcards and sepa payments does work perfectly. Il get the message <code>PaymentMethods of type 'ideal' cannot be saved to customers.</code> on url <code>vendor/craftcms/commerce-stripe/src/gateways/PaymentIntents.php at line 380</code>. What I'm missing? Version info:</p>
<pre><code>    &quot;craftcms/cms&quot;: &quot;4.4.16.1&quot;,
    &quot;craftcms/commerce&quot;: &quot;4.3.3&quot;,
    &quot;craftcms/commerce-stripe&quot;: &quot;4.1.2.1&quot;,
</code></pre>
<p>the form I'll use to add the paymentsource:</p>
<pre><code>&lt;form method=&quot;post&quot; class=&quot;form&quot;&gt;
    {{ csrfInput() }}
    {{ actionInput('commerce/payment-sources/add') }}
    {{ hiddenInput('gatewayId', plan.gateway.id) }}
    {{ hiddenInput('successMessage', 'Betaalmethode succesvol toegevoegd.') }}
    {{ hiddenInput('cancelUrl', 'account/pay'|hash) }}
    {{ hiddenInput('isPrimaryPaymentSource', 1) }}
    {{ redirectInput('account/pay') }}

    &lt;div class=&quot;cards-details__form__fields&quot;&gt;
        {% namespace plan.gateway.handle|commercePaymentFormNamespace %}
            {{ plan.gateway.getPaymentFormHtml({
            paymentFormType: 'elements',
            appearance: {
                theme: 'stripe'
            },
            elementOptions: {
                layout: {
                    type: 'tabs',
                    defaultCollapsed: false,
                    radios: false,
                    spacedAccordionItems: false
                }
            },
            submitButtonClasses: 'cards-details__button button',
            submitButtonText: 'Betaalmethode opslaan',
            })|raw }}
        {% endnamespace %}
    &lt;/div&gt;
&lt;/form&gt;
</code></pre>

<plugin-craftcommerce><stripe>
PaymentMethods of type 'ideal' cannot be saved to customers
# PaymentMethods of type 'ideal' cannot be saved to customers

(Asked by: username_0 on 2024-04-08)

I working on a craft commerce project with subscriptions. I have problems with saving a paymentsource of the type "ideal" and "bancontact" with stripe. Creditcards and sepa payments does work perfectly. Il get the message PaymentMethods of type 'ideal' cannot be saved to customers. on url vendor/craftcms/commerce-stripe/src/gateways/PaymentIntents.php at line 380. What I'm missing? Version info:
    "craftcms/cms": "4.4.16.1",
    "craftcms/commerce": "4.3.3",
    "craftcms/commerce-stripe": "4.1.2.1",

the form I'll use to add the paymentsource:

    {{ csrfInput() }}
    {{ actionInput('commerce/payment-sources/add') }}
    {{ hiddenInput('gatewayId', plan.gateway.id) }}
    {{ hiddenInput('successMessage', 'Betaalmethode succesvol toegevoegd.') }}
    {{ hiddenInput('cancelUrl', 'account/pay'|hash) }}
    {{ hiddenInput('isPrimaryPaymentSource', 1) }}
    {{ redirectInput('account/pay') }}

    
        {% namespace plan.gateway.handle|commercePaymentFormNamespace %}
            {{ plan.gateway.getPaymentFormHtml({
            paymentFormType: 'elements',
            appearance: {
                theme: 'stripe'
            },
            elementOptions: {
                layout: {
                    type: 'tabs',
                    defaultCollapsed: false,
                    radios: false,
                    spacedAccordionItems: false
                }
            },
            submitButtonClasses: 'cards-details__button button',
            submitButtonText: 'Betaalmethode opslaan',
            })|raw }}
        {% endnamespace %}

**Tags:** plugin-craftcommerce, stripe


---

## 2 answers

### Answer by username_0 on 2024-10-07. Score: 1

Finally I get it working. Be sure the payment methods you want to use are activated in the Stripe dashboard. Also be sure Stripe is added to the gateways in the CMS /admin/commerce/settings/gateways. Also be sure if you want to use subscriptions to add them in the CMS admin/commerce/store-settings/subscription-plans here.
With versions:
"craftcms/commerce-stripe": "4.1.2.1", 
"craftcms/commerce": "4.3.3",
"craftcms/cms": "4.4.16.1"

Also be sure using the right stripe settings in your env:
STRIPE_PUBLIC_KEY=""
STRIPE_API_KEY=""
STRIPE_WEBHOOK_SECRET=""
STRIPE_WEBHOOK_SECRET_TWO=""
STRIPE_PRICE_ID=""
DUMMY_PAYMENT=""

Example form for elements:
{% set plans = craft.commerce.getPlans().getAllEnabledPlans() %}
{% set plan = plans|first %}


    {{ csrfInput() }}
    {{ actionInput('commerce/payment-sources/add') }}
    {{ hiddenInput('gatewayId', plan.gateway.id) }}
    {{ hiddenInput('successMessage', 'Payment source added.') }}
    {{ hiddenInput('cancelUrl', 'account/pay'|hash) }}
    {{ hiddenInput('isPrimaryPaymentSource', 1) }}

    {% namespace plan.gateway.handle|commercePaymentFormNamespace %}
        {{ plan.gateway.getPaymentFormHtml({
        paymentFormType: 'elements',
        appearance: {
            theme: 'stripe'
        },
        elementOptions: {
            layout: {
                type: 'tabs',
                defaultCollapsed: false,
                radios: false,
                spacedAccordionItems: false
            },
            paymentMethodOrder: ['sepa_debit','card'],
        },
        submitButtonClasses: 'button',
        submitButtonText: 'Save payment method',
        })|raw }}
    {% endnamespace %}


---

### Answer by username_1 on 2024-10-04. Score: 0

Also experiencing the same issue. Did you found a solution for this?

Running Craft Pro 4.12.4 and Stripe for Craft Commerce 4.1.5.

> **Comments:**
> **username_0**: Yes I switched to stripe elements the way described here:  https://github.com/craftcms/commerce-stripe?tab=readme-ov-file#payment-forms  
> **username_1**: Hm, I tried that too, but even with the current example templates supplied by CraftCMS I am getting the same error after selecting iDEAL in the payment form, as soon as it it is returned from Stripe. Do you mind sharing some of the code you use in this payment flow? Thanks in advance!  
> **username_0**: I hope that my answer can help you further  

---

