#ronosho_unexpected
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1222094494908944435
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
You should include ideal in the payment_method_types when creating a checkout session
That's what I expected but when doing so I get this
{
"error": {
"message": "`payment_intent_data.setup_future_usage` is unsupported for payment method `ideal`.",
"request_log_url": "https://dashboard.stripe.com/test/logs/req_kF2308Rlk18hZ5?t=1711440514",
"type": "invalid_request_error"
}
}
Full request
POST https://api.stripe.com/v1/checkout/sessions
Authorization: Bearer {{api-key}}
Content-Type: application/x-www-form-urlencoded
mode = payment &
customer_creation = always &
payment_intent_data[setup_future_usage] = off_session &
currency = eur &
success_url = http://localhost:5146/webhook &
line_items[0][price_data][currency] = eur &
line_items[0][price_data][product_data][name] = Unit A1000 &
line_items[0][price_data][unit_amount] = 2000 &
line_items[0][quantity] = 1 &
payment_method_types[0] = card &
payment_method_types[1] = ideal
Ok, you should remove setup_future_usage from request param. Once the checkout session completes, you can get the sepa payment method ID from the checkout session's payment_intent->latest_charge object-> payment_method_details https://docs.stripe.com/payments/ideal/save-during-payment
That would mean in order to enable recurring payments we would have to use Stripe Elements and can't use the hosted checkout page?
No you can still use checkout
You can follow the same instructions to get the sepa payment method from a payment mode checkout session.
That would mean I would need to know the payment method type beforehand?
Ideally we would simply use the following
POST https://api.stripe.com/v1/checkout/sessions
Authorization: Bearer {{api-key}}
Content-Type: application/x-www-form-urlencoded
mode = payment &
customer_creation = always &
payment_intent_data[setup_future_usage] = off_session &
currency = eur &
success_url = http://localhost:5146/thank-you-page &
line_items[0][price_data][currency] = eur &
line_items[0][price_data][product_data][name] = Unit A1000 &
line_items[0][price_data][unit_amount] = 2000 &
line_items[0][quantity] = 1
And not specify the methods since these are handled by our clients.
Otherwise it would be easier to use
POST https://api.stripe.com/v1/payment_intents
Authorization: Bearer {{api-key}}
Content-Type: application/x-www-form-urlencoded
amount = 12500 &
currency = eur &
customer = {{customerId}} &
automatic_payment_methods[enabled] = true &
setup_future_usage = off_session
But can I use the client secret to pass it to a hosted checkout page?
Or you should remove payment_intent_data[setup_future_usage], and set setup_future_usage on the payment method level through payment_method_options
For example, setting https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_method_options-card-setup_future_usage tells Stripe to set setup_future_usage when your customer selected card payment.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
In this way, you won't get an error even if you include ideal in the payment_method_types