#crawl-checkout-trialandcoupon

1 messages · Page 1 of 1 (latest)

faint lionBOT
topaz pine
#

Hey @compact compass ! What have you tried? What's not working?

#

crawl-checkout-trialandcoupon

compact compass
#

Here i have a subscription with a lifetime coupon but this product does also have a 31 day trial
I dont know why it's not showing too

topaz pine
#

what's not showing exactly?

compact compass
#
        customer: customer.id,
        line_items: [
          {
            // Provide the exact Price ID (for example, pr_1234) of the product you want to sell
            price: STRIPE_PRICE_ID,
            quantity: 1,
          },
        ],
        mode: 'subscription',
        discounts: [{
          coupon: STRIPE_COUPON_ID,
        }],
        // success_url: `${redirect}/?success=true`,
        // cancel_url: `${redirect}/?canceled=true`,
        success_url: STRIPE_REDIRECT_URI,
        cancel_url: STRIPE_REDIRECT_URI,
        automatic_tax: {enabled: STRIPE_TAX_ENABLED},
      });

      return session.url;```
#

I'm supposed to see the message
free for X days then 30$/ month

topaz pine
compact compass
#

Not directly 30$ per month

compact compass
topaz pine
#

yes

compact compass
#

Ohhh ok, this is Legacy
I guess this has been deprecated recently
It was working before

topaz pine
#

that behaviour has always been like I described

compact compass
# topaz pine that behaviour has always been like I described

ok so how do you pass it inside the create i sent above ?

        customer: customer.id,
        line_items: [
          {
            // Provide the exact Price ID (for example, pr_1234) of the product you want to sell
            price: STRIPE_PRICE_ID,
            quantity: 1,
          },
        ],
        mode: 'subscription',
        discounts: [{
          coupon: STRIPE_COUPON_ID,
        }],
        //Here ??? 
        subscription_data.trial_period_days: 30,
    
        success_url: STRIPE_REDIRECT_URI,
        cancel_url: STRIPE_REDIRECT_URI,
        automatic_tax: {enabled: STRIPE_TAX_ENABLED},
      });```
topaz pine
#

you pass this similarly to how you passed enabled inside automatic_tax

compact compass
#

ok so

    subscription_data: {
      trial_period_days: 30,
    },
topaz pine
#

yep

compact compass
#

alright

#

thanks, will test this out

#

it's working

#

thanks