#CalebR-confirm-SI

1 messages ยท Page 1 of 1 (latest)

clear stone
#

Hello ๐Ÿ‘‹
what does your code look like currently?

fervent wasp
#
stripe.confirmSetup({
  elements: setupIntent.elements,
  confirmParams: {
    return_url: window.location.origin + reachpay.redirectUrl({supporter_id: supporterId, donation_id: donationId}),
    payment_method_data: {
      billing_details: billingPost,
    },
  },
  // Uncomment below if you only want redirect for redirect-based payments
  redirect: "if_required",
})

billingPost grabs the values of the address from a server request.

#

Setting it to

billingDetails.address = {
  line1: donation.address1,
  line2: donation.address2,
  city: donation.city,
  state: donation.state,
  postal_code: donation.postal,
  country: donation.country
}
#

State in this case would be null

clear stone
fervent wasp
#

req_rp45MEr6YhFrPW

#

Actually, that is the wrong request I think

clear stone
#

Ah yeah seems to be the wrong request

fervent wasp
#

Okay, so it's not actually getting to the request. The error is being thrown from Stripe.js:

Uncaught (in promise) IntegrationError: You specified "never" for fields.billing_details.address when creating the payment Element, but did not pass confirmParams.payment_method_data.billing_details.address.state when calling stripe.confirmPayment or stripe.confirmSetup. If you opt out of collecting data via the payment Element using the fields option, the data must be passed at confirm-time.
    u https://js.stripe.com/v3/:1
    r https://js.stripe.com/v3/:1
    s https://js.stripe.com/v3/:1
    n https://js.stripe.com/v3/:1
    de https://js.stripe.com/v3/:1
    _handleMessage https://js.stripe.com/v3/:1
    i https://js.stripe.com/v3/:1
    _setupPostMessage https://js.stripe.com/v3/:1
    addEventListener https://js.stripe.com/v3/:1
    _setupPostMessage https://js.stripe.com/v3/:1
    e https://js.stripe.com/v3/:1
    get https://js.stripe.com/v3/:1
    get https://js.stripe.com/v3/:1
    elements https://js.stripe.com/v3/:1
    o https://js.stripe.com/v3/:1
    a https://js.stripe.com/v3/:1
    setupElements https://rpay.reachapp.co/js4embed/reachpay.js:151
    createIntent https://rpay.reachapp.co/js4embed/reachpay.js:201
    submitDonation https://rpay.reachapp.co/donations/new:1099
    async* https://rpay.reachapp.co/donations/new:1121
    EventListener.handleEvent* https://rpay.reachapp.co/donations/new:1118
    ready https://rpay.reachapp.co/donations/new:898
    <anonymous> https://rpay.reachapp.co/donations/new:1110
clear stone
#

ah okay! and it only happens for UK addresses right?

fervent wasp
#

I haven't tried other addresses without states

clear stone
#

I'd suggest giving it a try while I look into the function itself

fervent wasp
#

Tried again with France, same result

#

Testing with a random Paris address from Maps: 10 Bd Montmartre, 75009 Paris, France

clear stone
#

Gotcha so it doesn't look like it works with States either so must be something with the function or the syntax

#

can you try console logging out billingPost before confirmSetup is called?
What are we seeing there?

fervent wasp
#

Sure, one moment

#

Okay, it looks like passing and empty string instead of null or undefined fixes the issue

clear stone
#

Awesome! yeah seems like the SDK doesn't like null values in the body

fervent wasp
#

Thanks!

clear stone
#

NP! Happy to help ๐Ÿ™‚