#bando-checkout

1 messages ยท Page 1 of 1 (latest)

lavish tiger
#

ok lemme check

lavish tiger
#
              subscription_data: [
                {trial_period_days: 7},
              ],```
#

like that?

#

or

            subscription_data: {
                'trial_period_days': 7
              }
novel shore
#

second one

lavish tiger
# novel shore second one

Thank you. I'm now onto using Create Subscription.

I was wondering if prices.trial_period_days returns empty if it will cause an error or if stripe will indicate that its empty and not to try to use it?

stripe.subscriptions.create({
  customer: 'cus_fdawfa',
  items: [
    {price: 'price_fwafP'},
  ],
  trial_period_days: prices.trial_period_days
});
#

Otherwise i have to copy and paste and do an if condition based on if prices.trial_period_days is null

novel shore
#

it will cause an error if you don't pass in null / empty for trial_period_days

lavish tiger
novel shore
#

sorry, typo, it will cause an error if you pass in null / empty for trial_period_days

lavish tiger
#

๐Ÿ™

#

Do you happen to know the max amount of trial_period_days you can have

novel shore
#

The maximum number of trial period days is 730 (2 years).

lavish tiger
#

have a good night

novel shore
#

๐Ÿ˜„