#claeusdev

1 messages · Page 1 of 1 (latest)

charred fieldBOT
frigid halo
#

hey there!

hexed loom
#

hello

frigid halo
#

Unless you mean you're trying to control fields appearing, rather than the default values in them, which is driven automatically by the requirements of the selected payment method type

hexed loom
#

yes i'm controlling fields that appear by default of the selected payment method type

frigid halo
#

ok that's a bit different than what you first described:

pass some custom default values

#

But what you're doing is already correct, you just can't force the fields to appear

#

It's automatic by the payment method type

#

If you want to collect a full billing address, you can use the Address Element for that:

hexed loom
#

Alright thanks. Using the address field works for card payment type but i get an extra "full name" field on bank account payment type. Is there a way to get around that?

frigid halo
#

Are you using billing mode for the address element?

#

In billing mode, fields should be de-duplicated with the payment element

hexed loom
#

yes billing mode: <AddressElement options={{mode: "billing", allowedCountries: ['US']}} />

#
<PaymentElement id="payment-element" options={paymentElementOptions} />
        <AddressElement options={{mode: "billing", allowedCountries: ['US']}} />
frigid halo
#

Hmm and you get a duplicate name field?

hexed loom
frigid halo
#

Hmm ok I'll need to reproduce that

hexed loom
#

Alright. thanks

charred fieldBOT
hexed loom
#

So i found a fix for the duplicates, i set the address field to never in the actual payment element form.

frigid halo
#

Ah nice, yes that would be one option