#ronosho_unexpected

1 messages ¡ Page 1 of 1 (latest)

random pineBOT
#

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

reef daggerBOT
lone rune
#

You should include ideal in the payment_method_types when creating a checkout session

wicked prism
#

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
lone rune
wicked prism
#

That would mean in order to enable recurring payments we would have to use Stripe Elements and can't use the hosted checkout page?

lone rune
#

No you can still use checkout

#

You can follow the same instructions to get the sepa payment method from a payment mode checkout session.

wicked prism
#

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?

lone rune
#

Or you should remove payment_intent_data[setup_future_usage], and set setup_future_usage on the payment method level through payment_method_options

#

In this way, you won't get an error even if you include ideal in the payment_method_types