#dongwan_best-practices

1 messages Β· Page 1 of 1 (latest)

supple haloBOT
#

πŸ‘‹ 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/1266465738663923905

πŸ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

dark carbon
#

Hi πŸ‘‹

That depends on how much detail you want. The Payment Element will only collect as much billing address details as it deems necessary to maxmimize conversion of the payment (i.e. prevent declines).

If you want to always be sure to collect a finer level of detail you should use the Address Element
https://docs.stripe.com/elements/address-element

static parcel
#

Thanks for the prompt response. The main reason we use the PaymentElement is to use Apple/Google pay. In this scenario, should i use Address Element when paymentElement's type is "card", right?

#

Also can you clarify how is gonna work when customers choose Apple/Google pay? since it's not collecting the billing address, the customers can only see the subtotal on the checkout page but they will eventually get charged the price with tax?

half bobcat
#

Hi there πŸ‘‹ jumping in as my teammate needs to step away soon. It largely depends on how much address information you're looking to collect.

For instance, when accepting card payments using the Payment Element it collects a value for Country by default, and will also collect a postal/zip code for US-based customers. If that's sufficient enough for your to get an accurate tax estimate, then you can likely work with the Payment Element alone. If you want to collect line1 details for a more precise tax calculation, that would require the use of the Address Element.

half bobcat
static parcel
static parcel
half bobcat
static parcel
#

Yes you are correct

half bobcat
static parcel
#

yeah that's what i assumed. since our FE is react, i added console.log to onChange function but under value, it only shows "{ type: 'card' }"

half bobcat
#

Hm, yeah, I'm seeing the same. Taking a closer look.

#

Apologies for the confusion, the change Events there aren't actually expected to surface address details. I think, though am not certain offhand, that the payment_method hash we're seeing in the value hash is only populated if a customer uses a saved payment method.

Taking that into account, I do think using the Address Element, or custom address fields, would be the best approach here.

static parcel
#

ok in that case, i assume i need to add the Address Element for "card" payment method.

half bobcat
#

I'm not sure I understand. You'd add it whenever you want to collect address details.

static parcel
#

i meant assuming Google/Apple pay would not need to collect the address from the Address Element, only credit card payment method requires to collect billing address to calculate the tax.

half bobcat
#

Sorry, I'm still a bit confused. I was under the impression you wanted to update the amount being used by the Payment Element to include the calculated tax amount before submitting the Payment Element. So I thought you'd still want to collect address information regardless of the Payment Method type selected in the Payment Element, so you can update the amount being used there before submission.

You can always test this in testmode though and see if the address and tax information are being populated as you're expecting.

static parcel
#

Ah sorry for confusion. I think you are right.

static parcel
#

Is there a way to use stripe tax with the billing address that’s already stored within apple pay/google pay in my scenario?

half bobcat
#

For Subscriptions, Stripe Tax pulls address information from the Customer record:
https://docs.stripe.com/tax/subscriptions#create-a-customer

if you're able to capture address details from Apple/Google Pay, and reuse the address from the Payment Method's details to update the Customer object, then I believe so. If I'm remembering correctly, the limiting factor there is that you can't force Apple/Google pay to collect address information when using the Payment Element.