#awolfe7

1 messages · Page 1 of 1 (latest)

slim patrolBOT
meager wraith
#

Hello! Can you provide more details about how you're sending people to Checkout in your Firebase app?

storm cipher
#

sure

meager wraith
#

It sounds like you're not using the Payment Link, but are instead creating Checkout Sessions in code?

storm cipher
#

Yes im using a checkout session. Im using the Stripe extension for firebase.

#

const customerRef = doc(db, 'customers', uid);
const checkoutSessionRef = collection(customerRef, 'checkout_sessions');

        const docRef = await addDoc(checkoutSessionRef, {
            price: priceId, // Replace with your actual price ID
            success_url: 'my web site', // your website's success url
            cancel_url: 'my web site', // your website's cancel url
            });onSnapshot(docRef, (doc) => {
            if (doc.data().sessionId) { // when session ID is available
                const sessionId = doc.data().sessionId;
               
                wixLocation.to( doc.data().url);
                
                //stripe.redirectToCheckout({sessionId});
            }
#

Basically I had it working well in an older stripe account using the same code from my web app. I feel like there is a setting Im not getting correct in the stripe dashboard.

meager wraith
#

I'm not sure I understand what's going on there. Where is the code that actually creates the Checkout Session?

storm cipher
#

So the code I showed you adds a document to a database and the stripe extension for firebase returns a url to that database then the web app navigates them there

meager wraith
storm cipher
#

Status
200 OK
ID
req_DDL0nkJtnEURgR
Time
9/7/23, 12:58:53 PM

meager wraith
#

Looking, hang on...

#

Is this using the same Price ID your Payment Link is using?

storm cipher
#

yes Thats why im so puzzled

#

Also If a user wants to modify their plan to a different subscription it also will not try to collect taxes through the customer portal

#

But If I go to the product and edit it, it clearly shows taxes for the product

meager wraith
#

You need to modify the code that creates the Checkout Session to enable that parameter, then it should work as expected.

storm cipher
#

Ok i hear you, that solves the checkout session problem. The reason I feel it is just a setting somewhere I need to change in the dashboard is if I have a user modify their plan aka go to a different subscription from the user portal it also does not try to collect taxes

meager wraith
#

Are the Subscriptions where tax isn't being collected by the Customer Portal ones where automatic tax is not enabled?

storm cipher
#

Can I set this from the dashboard?

meager wraith
#

It depends. Where and how are the Subscriptions in question being created?

storm cipher
#

I created them in the dashboard

meager wraith
#

I believe there's an option to enable automatic tax when you create them in the Dashboard. I'm not 100% sure, we're not Dashboard experts here.

storm cipher
#

lol ok feels bad

meager wraith
#

Yeah, looks like it's right there:

storm cipher
#

Ok sorry what I meant is i created the product in the dashboard. I am not actually assigning the subscription to the user in the dashboard

meager wraith
#

Okay, so where are the Subscriptions being created?

storm cipher
#

I dont know exactly what you mean. I am using checkout sessions for users to checkout with the product. Is the product different than a subscription?

#

I am creating the products in the dashboard then using their API id when creating checkout sessions for each user from my website. shown in the code I gave you.

meager wraith
#

Products represent the things you're selling, and Prices represent what you charge for a Product. You create a Checkout Session with one or more Prices to define what you're selling and how much to charge for it. If the Price is recurring, the Checkout Session will create a Subscription for your Customer. The Subscription is responsible for charging them on a recurring basis. The Subscription will generate an Invoice for each Subscription period to charge them for that period.

#

So it sounds like Checkout Sessions are being used to create these Subscriptions.

storm cipher
#

Yes

meager wraith
#

If automatic tax is not enabled on the Checkout Sessions it won't be enabled on the Subscriptions they create.

storm cipher
#

Yes so if I add that to my code it fixes the checkout session problem. But if the user wants to modify their plan they pick a new plan through a customer portal. If they do this when they select the new plan from the portal it does not assign any taxes to the new plan

meager wraith
storm cipher
#

ok So is that possible to do from the dashboard?

meager wraith
#

Looks like it, yep.

storm cipher
#

but arent you doing that for a single customer?

meager wraith
#

Yes, a single Subscriptoin for a single Customer.

#

You have to update them one at a time.

#

There's no way to bulk update a bunch of existing Subscriptions.

#

I recommend you write a script to update them via the API.

#

But you can do them manually one by one in the Dashboard if you want.

storm cipher
#

I dont have any users on stripe currently I dont want to modify any existing users. What I want to do is set up stripe so that if users in the future want to buy or change subscriptions they are charged taxes

meager wraith
#

I feel like we're talking past each other.

storm cipher
#

Im sorry im not trying to be dificult

meager wraith
#

Checkout Sessions that have automatic tax enabled will create Subscriptions that have automatic tax enabled. If a Subscription has automatic tax enabled changes to it via the Customer Portal will calculate tax.

storm cipher
#

What you just screen shoted me is a way to change how taxes are collected for a single users subscription

meager wraith
#

Does that make sense?

storm cipher
#

ok so let me test that real quick

meager wraith
#

Im sorry im not trying to be dificult
I know, and I didn't mean to imply you were. I was just flagging that we're having trouble clearly communicating key concepts, and I think we need to try different approaches. 🙂

storm cipher
#

Ok thank you that fixed it. My problem was I was testing it with test accounts that did not originally have the tax collection enabled when they bought their original subscription. Thank you!

meager wraith
#

Happy to help! Glad it's working now!