Open Nimo11 opened 1 year ago
After hour of search i have found solution. If you check in extension setting sync user, when a user is created in authentication list a user is also created in your users database path like explain in documentation. In the created user you can find to field stripeID and stripeLink needed to access user portal. So you must enable sync option to get values and make attention to keep this field when you save your data. Using merge option for exemple could be a good way.
Bug report
firestore-stripe-payments
]Describe the bug
Creation portal work fine only after subscription.
Same problem as https://github.com/stripe/stripe-firebase-extensions/issues/226
Sorry to ask on a closed topic but I don't understand the solution given by tanosugi. I tried adding to the user document the fields uid and email, but the behavior remains the same.
To Reproduce
after subscription with this code
final docRef = await FirebaseFirestore.instance .collection('users') .doc(FirebaseAuth.instance.currentUser?.uid) .collection("checkout_sessions") .add({ "client": "web", "mode": "subscription", "price": _productId, "success_url": 'https://www.success.com', "cancel_url": 'https://www.cancelled.com' });
this function display portal
` var functionRef = FirebaseFunctions.instanceFor(region: 'europe-west2').httpsCallable('ext-firestore-stripe-payments-createPortalLink');
but it doesn't work next time
Expected behavior
Display portal at any time
Firebase logs:
textPayload: "❗️[Error]: Customer portal link creation failed for user [mycustomerid]: Missing required param: customer."