#CalebR-confirm-SI
1 messages ยท Page 1 of 1 (latest)
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
can you try setting it to an empty String? not sure that'd make any difference though.
Also, can you share the request ID for the failed request? It should look something like req_xxxxxx
https://support.stripe.com/questions/finding-the-id-for-an-api-request
Ah yeah seems to be the wrong request
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
ah okay! and it only happens for UK addresses right?
I haven't tried other addresses without states
I'd suggest giving it a try while I look into the function itself
Tried again with France, same result
Testing with a random Paris address from Maps: 10 Bd Montmartre, 75009 Paris, France
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?
Sure, one moment
Okay, it looks like passing and empty string instead of null or undefined fixes the issue
Awesome! yeah seems like the SDK doesn't like null values in the body
Thanks!
NP! Happy to help ๐