#Naveed-VueJS

1 messages ยท Page 1 of 1 (latest)

swift roost
#

Hi, looking...

gilded depot
#

Or perhaps I need to rethink my entire approach. Perhaps I need to use stripe elements on a per-field basis? Maybe not using PaymentElement?

Is there something like that?

#

i need to collect this information btw. so not just country

swift roost
#

Maybe you can try this event?

#

only render your button when you receive this

gilded depot
swift roost
#

Still seeing the same screen recording ๐Ÿ˜…

gilded depot
#

Ok but does Stripe elements support those 2 additional fields i mentioned above

swift roost
#

never or auto. Payment Element will detect by itself and collect if it think it should

gilded depot
#

so what does auto do, based on what does it make the decision to collect

#

it might be at odds with business requirements right

swift roost
#

It's a detection engine, all I can say is it may look at customer location/ip and all the obligation/regulation we need to follow as a Payment processor

#

For example if the customer is in some countries, we know those countries regulation requires additional address etc

#

The idea is we take care of that, you don't need to

gilded depot
#

okay interesting so the default is 'auto' am i right?

swift roost
#

yes

gilded depot
#

so if thats the case then the form that gets loaded is dynamic

#

which means that if i were to add billing fields on my own

#

potentially id come across a situation where there are duplicate fields for billing address

#

unless i specify never that is...

swift roost
#

if you collect on your own, then:

  1. You pass the collected info in defaultValues when creating Element
  2. You set the corresponding fields as never
gilded depot
#

Dont understand this part

  1. You pass the collected info in defaultValues when creating Element
gilded depot
#

the element being created is to collect customer info, at that point in time i have no collected info

#

so u mean i can initialise with null?

swift roost
#

Oh this is prefilling

gilded depot
#

initialise billing fields with null or something?

swift roost
#

Sorry disregard step 2. Step 1 is enough for prefilling

gilded depot
#

hm i dont get it why do i need to prefill

swift roost
#

Because you already have your form right? I see

gilded depot
#

my form is basically a combination of Stripe + my own button + my own address fields

#

of course ideally all the form inputs are from Stripe

#

i havent added the address fields yet

#

so ignore that for now

#

itll be annoying becaus i need to match the UI of stripe for the form

swift roost
#

But you have plan to add your own address fields, correct?

gilded depot
#

yep

swift roost
#

Let's forget about prefilling. Collect address via your own address fields, disabling Stripe's Payment Element with never, then pass the information you collected in confirmation call

#

This part

If you disable the collection of a certain field with the fields option, you must pass that same data to stripe.confirmPayment or the payment will be rejected.

gilded depot
#

๐Ÿ‘ okay I will try this out