I've created some products on Stripe which I can retrieve using
curl https://api.stripe.com/v1/products -u sk_test_...: -G
I've installed stripe/firestore-stripe-payments@0.2.4 in Firebase https://firebase.google.com/products/extensions/stripe-firestore-stripe-payments and configured it using the same secret test key
In my website, I use the corresponding web sdk https://github.com/stripe/stripe-firebase-extensions/tree/master/firestore-stripe-web-sdk and have something like
const firebaseApp = initializeApp(firebaseConfig);
const analytics = getAnalytics(firebaseApp);
const auth = getAuth(firebaseApp);
onAuthStateChanged(auth, user => {
if (user) {
console.log('Logged in as '+user.email );
} else {
console.log('No user');
}
});
var userCredential = await signInWithEmailAndPassword(auth, ..., ...)
// Signed in
const user = userCredential.user;
const payments = getStripePayments(firebaseApp, {
productsCollection: "products",
customersCollection: "customers",
});
console.log('#Payments ' + JSON.stringify(payments));
const products = await getProducts(payments);
console.log('#Products2 ' + products.length);
const session = await createCheckoutSession(payments, {price: <a_hardcoded_priceId>,});
window.location.assign(session.url);
The createCheckoutSession seems to work fine, and I do see in Firebase a customers collection and inside my customer, I see a checkout_sessions collection.
But the returned list of products is empty.
Any idea what might be wrong?
All products have type=service (which might be the root cause if https://stripe.com/docs/upgrades#2018-02-05 is still relevant) but not sure how I can change this.
Suggestions I could try?
Additional info I could provide?