#nasa51 - link auth element & addresses

1 messages · Page 1 of 1 (latest)

tepid yokeBOT
pseudo helm
#

So you want the customer to be forced to enter a phone number?

analog plover
#

I'm collecting shipping address with stripe js, and I need customer to be forced to enter phone number for stripe shipping address element

Here is my js example:
const addressElement = elements.create("address", {
mode: 'shipping',
allowedCountries: ['US'],
fields: {
phone: 'always'
}
});
but in this case phone field says 'Optional'

pseudo helm
#

Ah, okay I see. You cannot force the collection of the phone number using only Stripe. You would need to request it in your own custom form and add form validation that requires it in order to submit the payment.

analog plover
#

Thank you, do you know if there is way on linkAuthentication element know if customer has saved addresses?

pseudo helm
#

Which element specifically are you talking about? Can you include a URL to the field/parameter/method you're talking about?

analog plover
#

yes, that element

pseudo helm
#

It would depend on when/where the address was being saved. linkAuthentication element has nothing to do with the customer's address

analog plover
#

address being saved on link, so for ease checkout I need to suggest select saved address from link account if any exists, so I looking for a way to check if there is any saved address after link login

pseudo helm
dusk hearth
#

Hey there just stepping in for two shoes

dusk hearth
#

You must place the LinkAuthenticationElement before the ShippingAddressElement (optional if you collect shipping addresses) and the PaymentElement for Link to autofill Link-saved details for your customer in the ShippingAddressElement and PaymentElement

So this should cooperate together well if saved, but you can also check for addresses on the customer as two-shoes noted by gathering the email address from the Link element with onChange:
https://stripe.com/docs/payments/link/accept-a-payment?platform=web#retrieving-email-address

Add the Link payment method to your custom payment form.

#

nasa51 - link auth element & addresses