Comments (11)
Noice. Thanks @thorsten-stripe! Looking forward to the release... We will need it for sure...
@JakeMalis I just ran into the first issue that this fix will solve for us (if you are also combining the user/customer collection).
Since the createCustomer
is triggered from a Firebase Auth hook, I just hit a race condition where my own createUser
function fails because createCustomer
triggered before my call to firestore.collection('users').doc(uid).create(props)
.
I could simply change the firestore call from create(props)
to set(props, {merge: true})
but then I loose the strong semantics I have around create vs update on my users collection without guarding every call myself.
It's a race so I don't always get this error and my logic could be refactored to account for it but I will opt to disable createCustomer
when it is available. Thanks again @thorsten-stripe.
from stripe-firebase-extensions.
Unfortunately deleting the createCustomer
function via the Firebase console will cause future updates to error (see #51 (comment)).
@jhuleatt are there any plans to allow on/off toggles per function during the installation of the extension? If not we'd have to build that in via some configuration dropdown for example?
from stripe-firebase-extensions.
Related to this question: I would love if there weren't two separate collections for customers and users. I have each Firebase auth user saved as Firestore doc with their uid as their name. I think most people also have it that way, it would be nice if all the stripe data was stored within their user doc.
from stripe-firebase-extensions.
Thank you @thorsten-stripe for your reply .It would be nice to have the ability to have on/off toggle functions during extension deployment/upgrade in future.
One more question I have on the integration. Stripe checkout does not support billing_cycle_anchor .I would have liked to have this so that I can consistently follow a single cycle for every customer.Without this we have to have complicated logic of resetting things every day based on users subscription .Appreciate any suggestion you may have on this.
from stripe-firebase-extensions.
@JakeMalis I wasn't aware either but it sounds like a single user/customer collection is supported: #51 (comment)
I'm going to test this out myself and will post back if I find anything adverse.
from stripe-firebase-extensions.
@ajbarry Thank you so much for sending me this, that helps a lot!
from stripe-firebase-extensions.
While this doesn't allow enabling/disabling of functions per se (that would be a feature request to the Firebase Extensions team), #77 allows the disabling of syncing customers on creation, which should solve most of the issues reported here. This will roll out with the next release v. 0.1.7, hopefully on Thursday PT.
from stripe-firebase-extensions.
Hey @thorsten-stripe ... any word on the 0.1.7 release for this fix?
from stripe-firebase-extensions.
@ajbarry sorry for the delay, the Firebase team has moved to a biweekly (every other week) release schedule. I checked with @jhuleatt and he let me know that it's scheduled for release on Thursday Oct 22nd PT time.
from stripe-firebase-extensions.
Ok great. Thanks for the update @thorsten-stripe
from stripe-firebase-extensions.
Noice. Thanks @thorsten-stripe! Looking forward to the release... We will need it for sure...
@JakeMalis I just ran into the first issue that this fix will solve for us (if you are also combining the user/customer collection).
Since thecreateCustomer
is triggered from a Firebase Auth hook, I just hit a race condition where my owncreateUser
function fails becausecreateCustomer
triggered before my call tofirestore.collection('users').doc(uid).create(props)
.I could simply change the firestore call from
create(props)
toset(props, {merge: true})
but then I loose the strong semantics I have around create vs update on my users collection without guarding every call myself.It's a race so I don't always get this error and my logic could be refactored to account for it but I will opt to disable
createCustomer
when it is available. Thanks again @thorsten-stripe.
I have been looking for someone who had the same issue like this!!
from stripe-firebase-extensions.
Related Issues (20)
- Emulator : SyntaxError: await is only valid in async functions and the top level bodies of modules HOT 1
- Update documentation for Mobile subscriptions
- Update to node 18 or 20 -> Node 14 will be deprecated on january 31 HOT 12
- Webhook handler for Stripe event failed: User not found! HOT 6
- createCustomer is not triggered
- createPortalLink success_url HOT 1
- success_url and cancel_url not working in mobile
- CustomClaims "stripeRole" is removed on overdue subscriptions.
- Firebase stripe extension Error creating secrets HOT 5
- Upgrade Cloud Functions to v2 (Gen2) HOT 4
- Support trial โย there's no longer the legacy option for setting a trial in Stripe HOT 2
- Dragon
- Dragon
- Webhook handler not updating cancellation details on Firebase. HOT 4
- cancel/resume/update subscriptions directly from firestore-stripe-payments
- Interacting with subscriptions in firestore-stripe-web-sdk
- Error installing HOT 1
- Extension requires deprecated feature of Stripe to support free trials for subscriptions HOT 4
- Embedded Payment Form
- Error: No such customer: 'cus_....' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stripe-firebase-extensions.