invertase / stripe-firebase-extensions

Repository of Firebase Extensions built by Stripe.
https://firebase.google.com/products/extensions
Apache License 2.0
431 stars 162 forks source link

Firestore Stripe Payments Does Not Collect Address as Expected #615

Open bigshirtjonny opened 5 months ago

bigshirtjonny commented 5 months ago

Bug report

Describe the bug

collect_shipping_address: true is not working as expected. I have a document in my products collection called shipping_countries that has an array field called allowed_countries that has ["US","CA"] in it. Then when the website redirects to Stripe there is no place in Stripe to collect the shipping address.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

const checkoutSessionRef = doc(collection(db, "customers", user.uid, "checkout_sessions")); try { await setDoc(checkoutSessionRef, { mode: "payment", collect_shipping_address: true, price: priceData, success_url: window.location.origin, cancel_url: window.location.origin + "/CoffeeBlendBuy?id="+new URLSearchParams(window.location.search).get('id'), });

Expected behavior

I expect the stripe portal to have a shipping address field

System information

rubao112 commented 1 month ago

Hello, have you gotten this to work somehow?

fearthelettuce commented 1 month ago

Hello, have you gotten this to work somehow?

I was struggling with this as well. You need to create a doc in your configuration collection (default is 'configuration') with Document ID = shipping_countries. The field in that document should be named allowed_countries, type array of strings. Then add the country abbreviations to that array, such as US