#anoush_72862

1 messages · Page 1 of 1 (latest)

willow juniperBOT
hallow pewter
#

Hi there!

#
  1. No, just add a free trial to your subscription
#
  1. Probably simpler to update the existing subscription to remove the trial
timber dawn
#
  1. in that case, which price to use if a user has not chosen any price yet, he/she just registers in my app
hallow pewter
#

oh got it. then yes you could try a $0 price in this case

timber dawn
#

in that case, after creating a trial, when the user wants to upgrade to the paid plan, should I cancel the free trial and create a new subscription? or update the existing subscription?

hallow pewter
#

up to you, but I think updating the existing Subscription is simpler.

timber dawn
#

ok, thanks
another question regarding the payment element,
On the front end, the payment element requires a client secret for initialization. So whenever a user clicks on a subscribe button, I create a subscription from the backend to get the client secret from the payment intent, and send it to the front end and after that, the payment element appears. There could be a scenario when the user clicks on a subscribe button many times. In my current implementation, I delete all incomplete subscriptions when the user clicks on the subscribe button. My question: is there a more accurate method to handle this? I mean create payment element without creating subscription to get client secret?

hallow pewter
timber dawn
#

seems that the link you provided does not use price_id to create payment method, and how it uses customer_id here?

hallow pewter
#

you use the price ID and customer when creating the Subscriptions

timber dawn
#

const options = {
mode: 'subscription',
amount: 1099,
currency: 'usd',
// Fully customizable with appearance API.
appearance: {/.../},
};

// Set up Stripe.js and Elements to use in checkout form
const elements = stripe.elements(options);
how do I pass subscription-related info here?

hallow pewter
#

you don't. you will create the Subscription later, that's the whole point of this flow

#

you create the Subscription at Step 6.

timber dawn
#

ok, thank you