#veiss - Subscription Trials

1 messages · Page 1 of 1 (latest)

unreal lantern
old knot
#

Yes but I didn't quite get how I can implement that in this code

const docRef = await db
.collection("customers")
.doc(currentUser)
.collection("checkout_sessions")
.add({
price: "price_1GqIC8HYgolSBA35zoTTN2Zl",
trial_from_plan: false,
success_url: window.location.origin,
cancel_url: window.location.origin,
});

as that part is handled by firestore extension.

unreal lantern
#

That part I'm not sure about. So you're not writing the code that actually creates the Subscription?

old knot
#

Nop. I send that data to firebase, that triggers that extension, it saves data to firestore and returns me sessionId that I use to redirect user to checkout.

#

it looks like this

unreal lantern