#Dara - Checkout Error Testing

1 messages · Page 1 of 1 (latest)

icy lake
#

Hello! We do not recommend using client-only Checkout at this point. That said, if you do need to use client-only Checkout, can you provide more details? Are you asking how to make the stripe.redirectToCheckout Promise resolve with an error?

split imp
#

oh what is that you dont recommend client only checkout?

#

yes i want to return the promised resolve with an error.

#

No wonder the documentation changed recently and it does not present the client only option anymore.

#

I want to add to the error state and alert the user.

#

With the server option, it is easy. Just throw new Error() lol

icy lake
#

I think you would need to use your browser dev tools to prevent network communication with Stripe to produce the error in the Promise.

split imp
#

But client only does that also. Is it more secure with server side that you recommend it?

#

I am only creating a short tutorial.

#

For my real apps, i am using server side. Don't worry! 🙂

icy lake
#

But client only does that also.

Does what also?

split imp
#

does redirect to cancel and success url also

icy lake
#

Yeah, but that has nothing to do with what you're asking about, right?

#

You want to get stripe.redirectToCheckout to produce a Promise with an error, correct?

#

The only reason it will do that is if it can't redirect to Checkout in the first place, so the only way to make that happen is to prevent it from contacting Stripe.

split imp
#

ok sounds good

#

Now, is there a particular reason Stripe recommends server side only now?

icy lake
#

It's a lot more flexible and powerful, and supports more features.

#

Client-only is quite limited because it's hard to provide much functionality due to security concerns.

split imp
#

That's what I thought.

#

Thanks.

#

It's harder to make a tutorial having to show front and backend lol

#

For a simple payment, I think maybe client only is enough.