#erikvm-checkout-trial-period

1 messages ยท Page 1 of 1 (latest)

rich kindle
#

@tough owl looking into this

#

give me a moment ๐Ÿ™‚

tough owl
#

Thanks

rich kindle
#

can you send me the exact code snippet?

tough owl
#
        checkout_session = stripe.checkout.Session.create(
 trial_period_days=7,   
      allow_promotion_codes=True,
            customer_email=customer.email,
            success_url=domain_url + "?session_id={CHECKOUT_SESSION_ID}",
            cancel_url=domain_url,
            payment_method_types=["card"],
            mode="subscription",
            line_items=[
                {
                    "price": basic_plan
                    "quantity": 1,
                },
            ],
        )
#

Ops, forgot the. trial part, one sec

rich kindle
#

looks like trial_period_days needs to be nested under subscription_data

tough owl
#

Is subscription_data an array?

#

Like line_items

#

Maybe its not even possible in the checkout session?

rich kindle
#

it should be a hash/dictionary

tough owl
#

Thank you! That did the trick

rich kindle
#

Great! glad that worked ๐Ÿ™‚