#Raghav.elements-billing

1 messages · Page 1 of 1 (latest)

sage oyster
#

Hey there! Which Elements are you using? The answer is generally no, unless you're using the Payment Element and the selected payment method requires address info

wide flare
#

i am using the payment element @sage oyster to collect my customer's card details using the setupIntent

sage oyster
#

If you need to capture billing address, then you'll need to do that separately

wide flare
#

then what is the use of useElements() hook

stark trellis
#

That hook is used to pass the payment details collect by the payment element to the confirmPayment function.

wide flare
#

so do you guys have any example code that uses stripe-react ShippingAddressElement @stark trellis

stark trellis
#

I'm not sure off the top of my head, let me see what I can find.

wide flare
#

Alright let me also do some quick googling from my side

#

Also if i directly use the component i am getting the following err

Uncaught IntegrationError: A valid Element name must be provided. Valid Elements are:
  card, cardNumber, cardExpiry, cardCvc, postalCode, paymentRequestButton, iban, idealBank, p24Bank, auBankAccount, fpxBank, afterpayClearpayMessage; you passed: shippingAddress.
stark trellis
#

I'm pretty sure shippingAddress is more of an object than an element

wide flare
#

But it's naming conventions suggests that it's an element

stark trellis
#

Apologies for the confusion, it seems that element is still in the works and isn't ready for consumption yet.

wide flare
#

well, what is the alternative that I can use? @stark trellis

stark trellis
#

Apologies, there may not be a way, but I'm still working on double checking that.

#

Thank you for your patience while I confirmed things.

So there isn't a way to force the Payment Element to collect billing information. It will collect these details if they are necessary for the payment method selected, but otherwise it won't. You will need to collect these details elsewhere in your flow.