#ziwengames_best-practices
1 messages · Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ziwengames_best-practices, 4 hours ago, 34 messages
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1221993623407558837
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
To work around this, I first collect the customer's payment information through stripe elements and create a payment method. Then I record the address they entered and set the customer object's address equal to that. That is how the tax corresponds to the address they entered from the credit card. I find this method quite problematic though, when there will be multiple products and recurring subscriptions ongoing. Tax for all products is dependent on the one address field in the customer object.
As mentioned in https://docs.stripe.com/tax/customer-locations#address-hierarchy, the address is checked obtained according to the order of the list.
If customer object has an address, it will be used first. Only when the address is absent from the customer's object, it'll then look at the billing address on the payment method
Sorry to specify, I'm using automatic tax = true.
To add on to your last sentence, if an invoice is being created before the customer has paid for the product, the customer object MUST have an address filled in. I've tried to create an invoice without an address for the customer and get errors.
My concern is then why is the automatic tax value based on the customer's address field and not the value of the address from the credit card (billing/shipping)? Sure I can just set the address equal to the address they put from the credit card. But then what if as they are ordering products, they keep using different credit cards with different addresses. Must it then be the case that right before the customer makes the purchase, we must change the address field accordingly?
Thanks for sharing the details. I don't have a great answer on why address is obtained from the customer instead of payment method. Can I suggest you writing to Support https://support.stripe.com/contact, so that they can check with the relevant team?
if an invoice is being created before the customer has paid for the product, the customer object MUST have an address filled in. I've tried to create an invoice without an address for the customer and get errors.
I can create an invoice without an address on the customer. Can you share the request ID (req_xxx) of the error? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_le5l4mH7ek8QJi
Thanks, I've emailed them so far but decided to check on this discord in the meantime
The reason why I ask this question is because I want stripe to automatically calculate the tax for me based on the user's location. And I would think that their "location" is based on what they put from the credit card and not some static address that I define. I feel like this is a common function that people would want to have on their app as their customers pay for things from different places, but based on the last staff I asked about this, it doesn't seem like other people have encountered this problem.
I see that you're using Subscription API in req_le5l4mH7ek8QJi. It's expected that the Subscription will take the location from the Customer. The reason being:
- After the invoice is finalised, the amount or tax can't be changed. Address on the payment method will not be considered since modifying the invoice amount is not allowed
A payment can only be collected after an invoice is finalised. The tax on the invoice has already been computed at the invoice finalisation
I set the customer's address based on address of the payment method that I collect from them (from this reply). That way, create_invoice() has an address to base its tax from.
After the subscription, the customer is able to purchase one off things. They are also able to use other credit cards with other addresses. I can continue doing the same thing in my reply, and it would work in theory (although it feels messy that I have to keep setting the address of the customer equal to the address of the card instead of doing something directly with the card, which I understand because the tax needs to be defined before the card is submitted for the invoice as you stated above). The problem is that if this is happening concurrently while the subscription automatically renews, the subscription might end up charging the wrong tax amount (because a one-off item was purchased at this exact time and the customer's address was set to something different from the customer's address for the subscription).
I guess if there is a question to be answered, is there a way I can base the tax ONLY on the customer's credit card information without doing the work around I mentioned? Or do people that integrate automatic tax usually assume that the customer resides in one place and always uses that location?
How do you integrate with Stripe for one-time payment?
This is actually a recent revelation, so I haven't implemented automatic taxes beyond the subscription process.
This is what I have: I give them a list of payment methods attached to them, which they can choose from. Or they can create a new payment method through stripe elements. Then I'd plan to do the same thing where I get their address and then set the customer's address field to the address from the payment method before creating and buying
If you use Payment Intent for one-time payment (https://docs.stripe.com/payments/accept-a-payment?platform=web&ui=elements), the Tax is calculated separately with Tax Calculation API that doesn't get address from the customer. It will use the address sent in the Tax Calculation API: https://docs.stripe.com/tax/custom
I see, I'm taking a look
How would I add the tax calculation to a current invoice or convert the tax calculation to be paid?
Tax Calculation API is only for one-time payment using Payment Intent directly. For payments via Invoice, that will not be possible. Invoice will use the address hierarchy in the doc
I see, so this would be more like an external calculation where we wouldn't be able to give the customer a receipt?
For one-time payment via direct Payment Intent integration, a receipt can be configured: https://docs.stripe.com/receipts?payment-ui=direct-api
However, it's a receipt of a payment and doesn't have line items like an invoice
ok I will make due with this information for now
I know it says in the doc, but just to confirm, I have to pay for each tax calculation?
Technically someone could spam my api to force us to make tax calculations right?
This channel is for technical integration questions and we don't have the necessary expertise to help you with fee related questions. Our Support team https://support.stripe.com/contact will be able to assist you better than I can
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Thank you