#stickyjams_OGC-checkout

1 messages · Page 1 of 1 (latest)

icy sail
#

No test mode and live mode data are separated. You use a test mode Price to create a Checkout Session with Subscription in test mode, and use a live mode Price to create one in live mode. That's it

#

You shouldn't need to set logic for which price id. It's decided by the api key

#

there are test mode secret key and live mode secret key

midnight locust
#

right but the api id would be different

#

meaning a product subscription in live mode is one price id, and in test data is another price id

#

so if i add the subscription, then the code would be like, if local -> use test price id, if production -> use live price id

icy sail
#

I would recommend saving the Price Id on some environment variable, or database, and switch value depends on your dev or prod deployment

midnight locust
#

okay that makes more sense

#

thanks