-
Notifications
You must be signed in to change notification settings - Fork 177
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
Extension requires deprecated feature of Stripe to support free trials for subscriptions #609
Comments
You may explain how to create a price with a trial period over the quick actions (billing)? Cause for me this options not seem to be visible. Edit: |
I've created a temporary workaround by editing the source code of the cloud functions created by this extension so that it will create a 30 day trial for customers who have not have a subscription before. This works for my particular circumstance because all of my subscription products will offer a 30 day trial. It won't work for anyone with some products that do not have a trial, or have varying periods - these things could be accommodated with further edits to the functions, picking up metadata or the like. @maertu these are the changes I've made to function 'ext-firestore-stripe-payments-createCheckoutSession' make this work while waiting for a resolution from Invertase. Hopefully it can help you:
|
Would you mind posting a repo for this? I'm still pretty new to coding and I'm not sure what files i'd need to mod to get this working. |
It looks like this has been fixed in next but not yet deployed to npm ( Line 4 in 6c5966d Would it be possible to get an ETA on this landing? |
The fix was applied, however, the way it works is different from the official docs:
|
So when creating a new checkoutSession, you're saying add the |
I can confirm this is working. I haven't placed an actual order yet using the free trial. But when I get to the checkout page after creating the checkout session object with the "trial_period_days" property, it shows on the checkout page a free trial for X days. Card will not be charged immediately but the card info is collected and charged after the free trial. |
The way I'm currently using this extension is by calling the functions from the client side. I can see an issue where users can just add their own trial days. Since this is just a field that's added to the checkout session and the users are creating this themselves essentially. Is this intended behaviour or am I doing it wrong? I get the impression that this API is not supposed to be used directly by client code on firebase? How do I mitigate this and what else is laying in wait for me to discover? Maybe I'm just misunderstanding how this is supposed to be used. |
I've managed to put a workable solution in place, this really should be documented because if I didn't go looking I would not have discovered this unless I had done a pen test on the system. Add a rule to firestore to clamp the value. This is sub-optimal since it clamps it for ALL subscriptions so you cannot vary it by subscription type.
|
Bug report
Describe the bug
Documentation of this extension states the following:
However Stripe no longer supports adding trial periods to pricing plans on products.
Currently, a trial period can be added to a pricing plan if it is added via Stripe's Billing > Quick Actions, but it is marked as 'legacy' in this workflow and cannot then be added if later pricing plans are needed on the product.
This workaround is currently effective in that the subscription is indeed created with the trial period on the pricing plan being honoured, however if it relies on a deprecated feature of Stripe then it will not be sustainable long term.
Expected behavior
If the addition of a trial period to a pricing plan is deprecated in Stripe, another method is needed to be able to bring this option from a pricing plan into the subscription that is created by this extension. Perhaps a required entry into the pricing plan's metadata, that can be picked up by the extension?
Screenshot of the documentation on the extension in Firebase
A free trial can be added to a pricing plan when creating it via Billing > Quick Actions, but it is marked as 'legacy'
If adding new pricing to the product created above, free trial options cannot be added in this workflow, meaning that for a product to be supported by this extension, it cannot ever have a price change after it's created.
The text was updated successfully, but these errors were encountered: