#Asp-pi-error
1 messages · Page 1 of 1 (latest)
Hey! Is there a specific question? The error is pretty descriptive: you're trying to confirm a Payment Intent that has previously been confirmed
(you can't confirm the same PI twice)
i only used one time for confirm payment intent
STPPaymentHandler.shared().confirmPayment(paymentIntentParams!,
with: self as! STPAuthenticationContext)
{ (handlerStatus, paymentIntent, error) in
switch handlerStatus {
case .succeeded:
print("sucess")
print("error",error)
if let paymentIntent = paymentIntent, paymentIntent.status == STPPaymentIntentStatus.requiresConfirmation {
print("Re-confirming PaymentIntent after handling action")
print(paymentIntent.stripeId)
}
else {
print(paymentIntent?.stripeId)
}
// Payment succeeded
// ...
break
case .canceled:
print("cancel")
print("error",error)
break
// Payment canceled
// ...
case .failed:
print("failed")
print("error",error)
break
// Payment failed
// ...
@unknown default:
fatalError()
}
}
// Payment succeeded, show a receipt view
break
case .error:
print("error")
// Payment failed, show the error
break
case .userCancellation:
print("userCancelled")
// User cancelled the payment
break
@unknown default:
fatalError()
}
this code i used only one time
You must have previously ran this logic for the Payment Intent then
If you share the Payment Intent ID I can correlate that
Payment intent not for me got failed error
Generated only client secret id in my backend side that client secret id i given to this line
STPPaymentHandler.shared().confirmPayment(paymentIntentParams!,
with: self as! STPAuthenticationContext)
I got only failed msg
Then that client_secret had been used previous to confirm that Payment Intent
We are not using this codes before
Your backend needs to create a new Payment Intent
Or if you can share the Payment Intent ID then I can see what's actually going on
Sure, np!
♥️