#amrux

1 messages · Page 1 of 1 (latest)

dense sapphireBOT
somber wadi
#

Hi there!

#

A) it depends on the payment method you are using. For card the postal code is mandatory with the Payment Element

zealous aurora
#

Ah yeah it's the card I'm referring to

#

B) Yeah I've done that, however it asks for other things such as "state" and "line1" I believe behind the scenes when creating the paymentMethod

somber wadi
#

I'm surprised about this, let me try to reproduce

zealous aurora
#

Thank! I'll send what Im doing if that helps too :)

#

Oh, I think I've just worked out the problem...

#

as opposed to doing:

  fields: {
      billingDetails: {
        address: {
          postalCode: 'never',
          country: 'never',
        },
      },
    }, 

I was doing:

  fields: {
      billingDetails: {
        address: 'never'
      },
    },

Which meant that it expected the whole object to be passed along

#

rather than just the specific values

#

Just a separate question then, if there is an issue with the postcode... we want to show it. Is there a specific error from the confirmPaymentIntent response if the postcode passed up has an issue, and do you know how to identify that error if so?

somber wadi
#

Ah yes indeed, you need to be more granular into the information you don't want to collect

zealous aurora
#

Makes perfect sense, sorry for the trouble on that one!

#

But yeah as you can see from the above , we want to prompt the user to try entering their postcode if there is any issues in the background, is there an exception we can "latch onto" that's specific to address / postcode failures?

somber wadi
#

Just a separate question then, if there is an issue with the postcode... we want to show it. Is there a specific error from the confirmPaymentIntent response if the postcode passed up has an issue, and do you know how to identify that error if so?
No I don't think so. Stripe doesn't do any validation on the postcode itself. It's just that the bank may decide to decline the payment

zealous aurora
#

Ah perfect thanks for letting me know :D

#

Appreciate all the help