Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(firestore-stripe-payments): allow to be specify trial period days #605

Merged
merged 5 commits into from
Feb 5, 2024

Conversation

jauntybrain
Copy link
Collaborator

Allows to specify number of trial period days before initiating checkout flow.
Does not depend on the now-legacy trial_from_plan parameter.

Fixes #599, #274

@CLAassistant
Copy link

CLAassistant commented Jan 28, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@pr-Mais pr-Mais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jauntybrain jauntybrain merged commit 0a13193 into next Feb 5, 2024
5 checks passed
@LimarenkoDenis
Copy link

LimarenkoDenis commented Feb 14, 2024

@jauntybrain Thank you!

I was waiting for this fix

@pr-Mais Do you know if https://extensions.dev/extensions/invertase/firestore-stripe-payments deployed with such fix ?

@carloshuff1
Copy link

carloshuff1 commented Feb 15, 2024

EDIT: Resolved by updating to the intertase firebase extension.

To anyone experiencing something similar, make sure you uninstall stripe/[email protected]
and install /invertase/[email protected] from the firebase extensions hub.

Potentially a noob problem, but when I specify trial_period_days its not taking me to a trial page. It is taking me to a regular subscription page without the subscription days added. Don't understand what i'm doing wrong.

Invertase stripe firebase extension. Firebase v9.

SNIPPET:

document.getElementById('start-free-trial').addEventListener('click', async () => {
            try {
                const checkoutSessionRef = collection(db, 'customers', user.uid, 'checkout_sessions');
                const docRef = await addDoc(checkoutSessionRef, {
                    price: 'price_fake1OdlyKKhmfO9fl4z8ZX65Qma',
                    trial_period_days: 7,
                    success_url: window.location.origin,
                    cancel_url: window.location.origin
                });

@jacob-i
Copy link

jacob-i commented Mar 19, 2024

Thanks for the fix!

@YoLoADR
Copy link

YoLoADR commented Jun 14, 2024

trial_from_plan

Thanks @carloshuff1 carloshuff1

And for more parameters : https://docs.stripe.com/payments/checkout/free-trials

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support trial — there's no longer the legacy option for setting a trial in Stripe
7 participants