#francois_unexpected
1 messages · Page 1 of 1 (latest)
👋 Welcome to your new thread!
⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1225367714412105749
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi there!
can you share the exact code you are using? and a PaymentIntent ID (pi_xxx) with this issue?
also do you see any error messages in the browser console?
nothing at all
here's the code:
const paymentResult = await stripe.confirmCardPayment(
response.clientSecret,
confirmPaymentPayload,
);
if (paymentResult.error) {
// handle error
}
if (paymentResult?.paymentIntent?.status === 'succeeded') {
// handle success
}
all of this is wrapped in a try / catch block with a finally statement, but we never get passed the await call
example of a failing payment id: pi_3P1lr2FpAKNo2Ml21mg0RUfq
does this happen all the time or only sometimes?
all the time on that specific site where we have the issue. never on other sites
and all sites are using the same code above
are all the sites using the same Stripe API keys?
yes, but payments are made for different stripe connect accounts
all under our own stripe account
the PaymentIntent ID you should shared is not using Stripe Connect.
I'm not sure I follow. but in any case, I don't think it's related to the stripe connect, cause we've hooked up the site that has the issue with another customer integration and we have the same failure. if we use that same customer integration on another site, it's working
so there's something on that customer site that must be causing that unexpected behaviour when we call stripe.confirmCardPayment, but we can't figure out why. we're doing things the same way
const paymentResult = await stripe.confirmCardPayment(
response.clientSecret,
confirmPaymentPayload,
);
can you log what's the value of response.clientSecret and confirmPaymentPayload?
response.clientSecret is a string, and it's the secret for creating the paymentIntent which we get from our back end
give me a mn to log the confirmPaymentPayload
response.clientSecret is a string, and it's the secret for creating the paymentIntent which we get from our back end
can you share the exact string you are passing?
but basically it's like this
const confirmPaymentPayload = {
payment_method: {
card: elements.getElement(CardElement) as StripeCardElement,
billing_details: billingDetails,
metadata: {
subjectType: response.subjectType,
},
},
};
CardElement being the element from the stripe library
or do you have a link where I can reproduce the issue?
I can but it's gonna be on our production payment
it doesn't want to log to the console, but the structure of the object when debugging is the same as it is on the other websites which are working
and client secret for this last attempt is "pi_3P1mVHFpAKNo2Ml20n1bI2nP_secret_QtZYfLIzZX3qusDcX56s7uEHz"
sorry for the delay, having a look
no worries
can you get us that repro page plus instructions?
ok hold on
https://www.staybardo.com/see-do/events/#!/e/how-to-enjoy-amaro-without-really-trying-52840fe5/
book the experience by clicking on "book experience" button.
go to check out, and there you'll see that after the booking request is done, we call the stripe.confirmCardPayment method, but it never resolves and the payment page remains hanging.
on our staging env
sorry
this is production ☝️
on our staging env, you can go to https://embed-demo.staging.letsway.com/brands/31a40edb-5808-4f6a-9905-afd264fc3239#!/e/walker-tester-74af8e98/ and do the same. you can use the 4242 card there. you will see here that after the booking request is made, we correctly call the confirmation endpoint and the payment is correctly processed
total guess but maybe you have some bad polyfills, I've seen that break things
that would cause the promise to never resolve ?
sure, sometimes sites/libraries have broken implementations of window.Promise because of bad polyfills
it's only really a guess, but you can see that the broken page does have a bunch of Wordpress stuff like https://www.staybardo.com/wp/wp-includes/js/dist/vendor/wp-polyfill.min.js?ver=3.15.0 loaded
but when I stepped into the code, I didn't see that I was going through a weird polyfill
yeah I've seen what they have in their. they also have weird scroller logic that breaks the debugger sometime
I was wondering if there was something else though, maybe this happened somehow previously to have that promise hang and never resolve
FWIW a breakpoint on handlePaymentSubmit's first line in BookingForm.js doesn't get hit for me
maybe that's just a sourcemap issue but maybe it means your code is doing something wrong before that point
go to checkoutPage.tsx
you're not in the right file
we'd notice if that code was broken 🙂 it's running for undred of websites, processing quite a few bookings & payments
I see. I can't set breakpoints there anyway probably due to minification or whatever
yeah
anyway I'll look some more but now I would say you have some broken global object that is breaking something that our library uses so try stripping down the page and removing other libraries/frameworks etc
ok thanks, we'll look into this
the weird thing is that we use promises in our code as well obviously, and we're not seeing that behaviour of hanging promises anywhere else
it's just on this function call
it's just a guess, I could be wrong
also did you change something on the site? I was trying to debug some more but now the CardElement is not mounted at all.
No, nothing
ah nvm, it was a network issue on my end
They set CSP to allow for stripe, I don’t think we’re usually required to do anything else
But since the card element loads I didn’t think it could be something like that
it was on my side, don't worry about it
Are you able to step in the confirmCardPayment function ? Cause we couldn’t do that
Maybe you can see something in there ?
not really since it's all obfuscated
besides breakpoints seem to barely work on that page for some reason, they refuse to get set
at this point I'd suggest writing to https://support.stripe.com/?contact=true so we can dig further
Ok
I intentionally blocked some of the suspicious libraries from loading in case that helped but not really
Is there some info I can pass to link to what you’ve been searching for ?
Yeah and we’re still not seeing the call made by the stripe lib to confirm the payment, which we see on other websites
not really but feel free to say you were asking about this on Discord and hopefully the ticket will get routed quickly
Alright. Thx