#Indikakis2

1 messages · Page 1 of 1 (latest)

rapid pawnBOT
dense ridge
#

Could you share your code of confirmCardPayment?

visual jewel
#

const cnfResult = await stripe.confirmCardPayment(clientSecret, {
payment_method: pmId,
return_url:window.location.origin + '/post_stripe.php'
});
if(cnfResult.error){
addMessage(cnfResult.error.message);
return;
}
else{
if(cnfResult.paymentIntent.status === "succeeded"){
// addMessage("Payment Success");
}
else{
addMessage("PaymentIntent status: " + cnfResult.paymentIntent.status);
//console.log("PaymentIntent status: " + cnfResult.paymentIntent.status);
}
}

dense ridge
visual jewel
#

So to perform a similar return_url action in stripe.confirmPayment for the confirmCardPayment, I would have to manually add a redirect code? e.g. if(cnfResult.paymentIntent.status === "succeeded"){
location.replace (.....)
}

dense ridge
#

Yes, you're right! confirmPayment has ability to control the redirect behaviour whereas confirmCardPayment can't. In order to achieve the same redirection behavior in confirmCardPayment, it can only be done manually

visual jewel
#

Thank You so much.