#thomas-d

1 messages · Page 1 of 1 (latest)

glass rampartBOT
latent igloo
#

Are you trying to do a server-side redirect?

tawny adder
#

yes

#

i need to redirect to client and client can redirect to server ?

latent igloo
#

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)

tawny adder
#

I try synchronously

latent igloo
#

What do you mean?

tawny adder
#

after checkout session create i redirect user in route and i want to get setup_intents but is null in session object

latent igloo
#

Can you share the session id?

tawny adder
#

cs_test_b1DsODONQkVjJ1hz9BfiPmzjaYVbtYQ2laN6ABCsAlX6QtMTBo3COraV7t

#

in log is also null

latent igloo
#

That's a payment mode checkout session so there won't be a setup intent

#

In payment mode they're payment intents

tawny adder
#

sorry i don't understand, I must change payment mode ?

latent igloo
#

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

tawny adder
#

accept a payment

latent igloo
tawny adder
#

ok but i already do this because session is create

latent igloo
#

Yeah I know

#

You were just following the wrong guide

#

There won't be a setupintent if you're in payment mode

tawny adder
#

but there is only the possibility to put the mode of payment or subscription

#

and i don't want to use subscription mode

latent igloo
#

If you're trying to accept a payment, then payment mode is the correct mode to use

tawny adder
#

and so why setup_intents is null when my session object is create

latent igloo
#

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

#

But if you're trying to accept a payment, you should NOT be in setup mode. Payment mode is the correct flow

tawny adder
#

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

latent igloo
#

That's not supported by default. You can reach out to support to see if you qualify for that to be enabled on your account

#

Otherwise, you'll just need multiple payment intents