#touchyspidey

1 messages · Page 1 of 1 (latest)

final violetBOT
humble socket
#

Hi 👋

#

The CLI is just for rapid testing purposes, what are you trying to do?

hot ice
#

basically i'm creating a checkout session in my backend, but i want it to be finalized as if a user actually paid

#

everything local of course, i need to test this one thing to set the webhooks in production

humble socket
#

Why does the ID need to be specific?

hot ice
#

are you suggesting that i don't need it?

#

when doing checkout a customer gets generated on the fly if it didn't exist

#

i kinda need that don't i?

#

user clicks [subscribe] button
frontend makes xhr to backend "hey let's make this user subscribe"
backend creates stripe checkout, and returns the url -- customer doesn't exist
frontend redirects user to that url
user pays up
stripe triggers event to my webhook, event contains customer_id (newly generated)
backend looks up in db searching for that pending checkout session that needs to be upgraded to a subscription

humble socket
#

You didn't say anything about a Customer id

#

you said a Checkout Session ID

hot ice
#

which is what i need to force, because i need it to match the one that was generated

#

customer_id can get newly generated, i don't care

#

am i not making sense?

#

when completing my checkout, the stripe cli makes fixtures: makes a new customer (cool), but makes a new checkout session (not cool, because how will i ever mark the existing one as completed and associate the userid to the newly generated customerid?)

#

but.. is it possible? i'm starting to wonder why you aren't giving me a straightforward answer

#

i was guessing i just needed to --add checkout_session:something=the-value

#

now you're crushing my expectations

humble socket
#

I don't think it actually maps properly to your testing scenario

#

The stripe trigger checkout.session.completed will not have a specific ID because it will require creating a new Checkout Session on you account