#equilibrium_paymentelement-billingdetails
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/1263552237872087053
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
What do you mean here? What do you want to hide?
Sorry, I accidentally submitted the form incomplete, I'll add the rest now as a message
we currently have:
we added the email as a custom field (since Stripe payment element doesn't not support email, card holder, billing address etc..
if the customer switches to Apple Pay, it should be 1 click to submit the form right?
in our case the customer is still required to add the email
This is payment link, and we expect the Apple Pay (and other wallets payment) to be 1 click
This looks like a preview of a checkout screen.
yes, my bad, I meant payment link
in payment link/checkout the "Apple Pay" is separate from ther card payments (And its a 1 click checkout)
in payment element, we dont know whent he user clicks on the wallets, ... so we cannot hide/disable the custom fields
Okay those appear to be two entirely separate UIs and you cannot expect the same behavior
true, im aware that payment link/checkout is different from payment element
is it possible to add custom fields in the payment element (as we did in the 1st image) and still over only 1 click checkout for wallets like Apple Pay and Google Pay, etc..?
because users shouldnt fill the email and other infos for wallets
If you add custom fields above the Payment Element, then you have control over whether they are displayed or not.
You cannot add custom fields inside the Payment Element
yep, thats true, we do control that
but when the user clicks the Apple Pay/Google Pay.. the custom fields (like email and cardholder.. which we plan to add later) still show up
is there any way to listen to events from the payment elements? and hide the custom fields accordingly in case the user selected a wallet payment like Apple Pay?
I hope this is clearer now
Assuming you are referring to separate inputs that you control, you can listen to the change event.
https://docs.stripe.com/js/element/events
The event.value property will indicate which item is selected
Would that be triggered if the user picked a new wallet?
for example, we can check the current option selected and decide the show/hide the additional custom fields (like email and cardholder)
oh sorry, I missed the event.value part which confirms that, right?
Yes that will indicate whether or not the user has selected a wallet
I see it
{
elementType: 'payment',
complete: false,
empty: false,
collapsed: false,
value: {
type: "card",
payment_method?: {
id: "",
type: "",
billing_details: {
address: {
line1: "",
line2: "",
city: "",
state: "",
postal_code: "",
country: "",
},
name: "",
email: "",
phone: "",
},
},
},
}
we can read
type: "card",
and process things from our end
Yup!
perfect! looks promising
It also fires when the payment element is first rendered so you know what the default payment method is
yep yep
I have another question if you don't mind
we are trying to enforce Radar rules to block payments that do not include cardholder or email address (as the attacker was manipulating the form and sending an empty email address)
no email address -> less Radar metrics -> fraud purchases getting allowed
so I would like to know if Wallet forwards email addresses and cardholder names by any chance? (in case we didn't pick them by the custom fields)
we tried Apple Pay for example, and we had the customer email + customer name automatically picked up, but I'm just trying to confirm it in general and for other wallets
happy to clarify it more if needed
Unfortunately I think it depends on the wallet. For instance, for Google Pay I don't see this data showing up in the Payment Intent. But the billing details on the Payment Method contain name, email, and address
Oh wait. sorry I configured my integration to collect that. Let me adjust
Okay no, I do not see this information included
so we cannot find the data available per wallet as per your last message
for example:
card payment (we are gonna add email + card holder custom fields)
wallets:
- Apple Pay: based on a quick test, it does forward the email + name to Stripe
- others: not sure
we might try to block all payments where name + email are not available (but this might block some wallets that do not forward the name)
otherwise, we might keep it simple and just block the payments with no email (I believe all wallets should forward that)
am I missing something?
To be 100% certain, I would collect the name and email and include them in the payment_method_data.billing_details when you confirm the payment intent.
yep, this is what we were doing now. we were collecting these details via custom fields and passing them to Stripe (in the case of card and all wallets)
we are trying to optimize the flow a bit now (that's why I asked my previous question).. we are trying to not request email twice for Apple Pay since this is considered a wallet and 1 click checkout (aka we are trying to have fewer clicks/friction)
Yeah that makes sense. Unfortunately there isn't a clear way currently to know when you need those fields/data.
got you, no worries, I think maybe if we limit the number of available options (like Card + Google Pay + Apple Pay only)
and we test the available data for these wallets, this way we can kinda confirm that we will have (or not have) the email + name
That sounds like a reasonable approach. I would also recommend you keep tabs on our Changelog
https://docs.stripe.com/changelog
I think there are plans to improve the Payment Element's ability to request more info from wallets.
sounds great, thank you for the help! I appreciate it
I'll definitely keep an eye on the updates!
thanks again
Sure thing, happy to help ๐