#dale_best-practices
1 messages ¡ Page 1 of 1 (latest)
đ 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/1270434161580052491
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- dale_best-practices, 5 days ago, 7 messages
I've seen a similar implementation on kinsta.com, but they're not using Address element at all, but their own custom form. This means that they lose all the sugar that comes with Address element (autocomplete, validation). And they use their own API to update Stripe customer billing info.
Hi, are you looking for this custom behavior, https://docs.stripe.com/elements/address-element/collect-addresses? Are you able to review that file and let me know if that is what you're looking for. If not, can you reword the ask please to ensure that we are on the same page?
Sure thing, give me a moment to read the docs.
Wow, yes, that's what I'm looking for! Thank you! I'm not sure how did I miss this one in the docs.
Can I ask another question here? It's still related to best practices, but not specifically to Address element.
Sure, happy to help
Alright, awesome!
The flow I'd like to have is:
- Customer creates a team (or we create the default one when the customer sign ups in our system)
- Customer wants to buy a subscription, but before that is possible, we require the customer to setup the team; this includes: choose subscription item, provide billing information etc...
For this flow, I should create the PaymentIntent, right?
I've tested this, and for some reason, the billing information provided in the PaymentIntent is not stored in Stripe customer, but only for that particular subscription.
I'm not sure did I do something wrong. Since one team represent one customer, I'd love if this would be automatic.
And regarding my previous discussion, I've asked about order summary and how to show tax on it.
At this point, I know what product the customer wants to buy, and I also have the billing information of the customer.
I could use the Stripe Tax API for this, correct?
The Billing details collected would not automatically transfer to the Customer object. You would need to make a call to upadte the customer, https://docs.stripe.com/api/customers/update explicitely.
Can you provide a summary of your previous discussion please?
Okay, how would I do this?
If I use Address element as part of the PaymentIntent, can I still use getValue() on it to collect the address and update customer, while also using those billing details for the subscription?
I did not know how to display order summary for the customer that includes the tax information (percentage, or total amount of tax).
A colleague of yours answered that it is not possible, at all, but I've seen sites using this (any WooCommerce site pretty much), which makes me think that there must be a way.
I want to display this after the customer chose the item and gave billing details (basically, before clicking final "BUY"), I think this is crucial for tax, because, at that point, I should be able to know the tax value.
Basically, this would be an example of what I want:
- Item #1, $100
- Item #2, $50
- Subtotal $150
- Tax 10%, $15
- Total $165
You can retrieve the payment method id, https://docs.stripe.com/api/payment_methods/customer and attain the billing details, https://docs.stripe.com/api/payment_methods/object#payment_method_object-billing_details.
Sorry, I don't understand.
What if the customer puts Germany as country in billing details, but uses card that is issued in Netherlands?
Which one should I use for tax? And should I even use Tax API for this?
Ah, with tax I'm unsure. I was referring to the address question relating to where to attain this data etc.
Oh, okay, I misunderstood that haha
As far as tax and its compliance, I do not think we can advise on that.
You'd want to talk to your CPA
I'm not sure how Kinsta guys did it, but they do have this. And I know they use Stripe. What I don't know is if they're using Tax API, or they have taxes for each country (or region) on their own and calculate it like that.
Currently, there is not a way to show a tax breakdown for your 'I did not know how to display order summary for the customer that includes the tax information (percentage, or total amount of tax).' question.
It could be possible that they have their own custom thing
Okay, I'll figure something out. Perhaps my first implementation will just redirect the customer to Stripe, as that's the easiest thing.
Thanks anyway for trying.