#nasa51 - link auth element & addresses
1 messages · Page 1 of 1 (latest)
So you want the customer to be forced to enter a phone number?
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'
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.
Thank you, do you know if there is way on linkAuthentication element know if customer has saved addresses?
Which element specifically are you talking about? Can you include a URL to the field/parameter/method you're talking about?
Do you mean this one? https://stripe.com/docs/js/element/link_authentication_element
yes, that element
It would depend on when/where the address was being saved. linkAuthentication element has nothing to do with the customer's address
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
Can you simply check the Customer object (see Customer.address hash: https://stripe.com/docs/api/customers/object?event_types-payment_intent.payment_failed#customer_object-address) and/or the Payment Method's billing details?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Hey there just stepping in for two shoes
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
nasa51 - link auth element & addresses