#thomas-d
1 messages · Page 1 of 1 (latest)
Are you trying to do a server-side redirect?
Yeah I think easiest thing would be to return the url in the response from your server and just return a 200 status code
Then use js on the client side to redirect to that url
Setting window.location.href
Or however it's done in nextjs (haven't used it before)
ok but in this page https://stripe.com/docs/payments/save-and-reuse?platform=web&ui=checkout
and he gets the setup_intents id and me setup_intents id is null...
I do stripe.checkout.sessions.retrieve(id) in success url
I try synchronously
What do you mean?
after checkout session create i redirect user in route and i want to get setup_intents but is null in session object
Can you share the session id?
cs_test_b1DsODONQkVjJ1hz9BfiPmzjaYVbtYQ2laN6ABCsAlX6QtMTBo3COraV7t
in log is also null
That's a payment mode checkout session so there won't be a setup intent
In payment mode they're payment intents
sorry i don't understand, I must change payment mode ?
Depends what you're trying to do
Are you trying to accept a payment or just collect payment method details
The doc you shared is just for the latter
accept a payment
Then follow this guide instead: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=checkout
ok but i already do this because session is create
Yeah I know
You were just following the wrong guide
There won't be a setupintent if you're in payment mode
but there is only the possibility to put the mode of payment or subscription
and i don't want to use subscription mode
If you're trying to accept a payment, then payment mode is the correct mode to use
and so why setup_intents is null when my session object is create
Because you're in payment mode as I already said
SetupIntents are not used when accepting a payment
PaymentIntents are used
The whole point of SetupIntents are to set up a payment method without charging the payment method
SetupIntents are only available for Checkout Sessions in setup mode. See: https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-mode
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
But if you're trying to accept a payment, you should NOT be in setup mode. Payment mode is the correct flow
ok I will review the documentation quietly but I actually wanted to capture the payment in two times. half and the rest after. I managed to capture the payment in full but when I use amount_to_capture in stripe.paymentIntents.capture then when I try to capture the rest then I have an error "This PaymentIntent could not be captured because it has already been captured"
I’ll take a break thanks anyway