#morey-payments
1 messages · Page 1 of 1 (latest)
Hi again!
"client_secret":"pi_3JjsuuLXSN9kljfY1ArOZ6uQ_secret_dWJpRtgw6zfnjGa3dLDTafayN",
was the client secret i sent in that
What are you trying to do here? Is there a reason you're not just using a Payment Intent ID to retrieve server-side?
Ah, I was trying to do it earlier from front -end
// Hide the 3DS UI
yourContainer.remove();
// Check the PaymentIntent
stripe.retrievePaymentIntent('{{PAYMENT_INTENT_CLIENT_SECRET}}')
.then(function(result) {
if (result.error) {
// PaymentIntent client secret was invalid
} else {
if (result.paymentIntent.status === 'succeeded') {
// Show your customer that the payment has succeeded
} else if (result.paymentIntent.status === 'requires_payment_method') {
// Authentication failed, prompt the customer to enter another payment method
}
}
});
}
window.addEventListener('message', function(ev) {
if (ev.data === '3DS-authentication-complete') {
on3DSComplete();
}
}, false);```
but retrievePaymentIntent was null on the react package
so. Itried verifyin on server. But I Iguess I misread documentation
Hmmm... you should be able to retrieve a Payment Intent client-side. Were you getting some kind of error?
Glad to hear it works from the backend now!
`TypeError: Cannot read properties of null (reading 'retrievePaymentIntent')
`
Used it like this
payment_intent_client_secret_string,
);```
strange I refreshed and it now worked
0 code change
So now it works?
nope
this was the string passed: pi_3JjsuuLXSN9kljfY1ArOZ6uQ_secret_dWJpRtgw6zfnjGa3dLDTafayN
What did you mean when you said "strange I refreshed and it now worked"?
one of the times I refreshed earlier it actually got me the stripeIntentResult
But I can't replicate it
Gotcha - so I'm guessing the issue is that Stripe hasn't fully loaded by the time you're making this request. You need to take a look at your code and make sure you can guarantee it's load at that point