Reputation: 2625
This is my setup:
destination
in transfer_data
on the Payment Intent)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 enabledeur
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.
Upvotes: 0
Views: 2019
Reputation: 1704
This was not mentioned in the docs as far as I can see.
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:
'payment_method_options' => [
'card' => ['setup_future_usage' => 'off_session'],
'{other-method}' => ['setup_future_usage' => 'off_session'],
],
This will only apply the setup_future_usage
argument if card
or {other-method}
are selected.
API docs for this.
Upvotes: 3