This is my setup:
- Stripe Connect
- Destination charges (using
destination
intransfer_data
on the Payment Intent) - Express accounts (probably unrelated)
- I have activated multiple payment methods both in my live and test account
- The below is all in my local environment and Stripe’s test environment
This is the data that I pass to create the Payment Intent via the API:
[
'amount' => 100,
'currency' => 'eur',
'application_fee_amount' => 10,
'transfer_data' => [
'destination' => $connectedAccountId,
],
'automatic_payment_methods' => ['enabled' => true],
'setup_future_usage' => 'on_session',
'receipt_email' => $email,
];
And the JS code for the Address and Payment Element:
const elements = stripe.elements(options);
const addressElement = elements.create('address', {
mode: 'shipping',
allowedCountries: ['{{ $user->country->iso2 }}'],
defaultValues: {
name: '{{ $user->first_name.' '.$user->last_name }}',
},
});
const paymentElement = elements.create('payment', {
layout: {
type: 'tabs',
},
defaultValues: {
billingDetails: {
name: '{{ $user->first_name.' '.$user->last_name }}',
address: {
country: '{{ $user->country->iso2 }}',
},
},
},
});
paymentElement.mount('#stripe-payment');
The Payment Element does not show local payment methods like iDEAL when the country is The Netherlands. I have enabled this payment method in my test environment in Stripe.
I would expect it to show up, because:
automatic_payment_methods
is enabled- The currency is
eur
- I have enabled the payment method in the dashboard (both test and live environment)
- The country is The Netherlands (where iDEAL is used)
At first I thought it was something with the setup of Stripe Connect and the connected accounts. When using destination charges, the platform payment settings (not the connected account payment settings, these are Express accounts) should be used so by setting transfer_data[destination]
this should work I think.
Another relevant piece of information is that if I create a Checkout Session via the API, the checkout page does show the local payment methods correctly.
3
Answers
The issue turned out the be the following property on the Payment Intent:
'setup_future_usage' => 'on_session'
If I remove this, the payment methods show up correctly. This was not mentioned in the docs as far as I can see.
It’s better to reach out directly to the Stripe Support https://support.stripe.com/?contact=true or go to the Stripe Discord server this is better handled when looking directly at your account settings, rather than just speculating.
setup_future_usage=on_session
saves the payment method for future use, which is only supported for some payment method types. Depending where your account is based and the currency you’re using, this could dramatically decrease the amount of payment method types rendered.This is documented here:
https://stripe.com/docs/payments/payment-methods/integration-options#additional-api-supportability
If you want to get the best of both worlds, you can implement payment-method-specific
setup_future_usage
behaviors, like this:This will only apply the
setup_future_usage
argument ifcard
or{other-method}
are selected.API docs for this.