#zishaansunderji-terminal
1 messages ยท Page 1 of 1 (latest)
Hi ๐ I'm working on pulling up that Payment Intent. While I do, could you clarify where you're seeing the error that you referenced being returned from?
Hi! Awesome! Yepp for sure!
I believe the error comes during this step:
Terminal.getInstance().processPayment(collectedIntent, object : PaymentIntentCallback {
override fun onSuccess(@Nonnull confirmedIntent: PaymentIntent) {
}
override fun onFailure(@Nonnull e: TerminalException) {
// This is where the terminal throws the error 30 exception
}
}
Thank you. Yeah, I think I'm seeing the same thing you did, that the Payment Intent was successfully confirmed.
Reviewing the spec for the processPayment function, it does look like a null Payment Intent ID in the response is indicative of a timeout and we have some guidance there on how to handle those scenarios:
https://stripe.dev/stripe-terminal-android/core/modules/core/com.stripe.stripeterminal/-terminal/process-payment.html?query=fun processPayment(intent: PaymentIntent, callback: PaymentIntentCallback)
Gotcha! So for the first scenario of retrying the processPayment method again - what should I expect from doing that? Will it say the payment has already been processed?
๐ stepping in for toby as they need to step away.
Hi, sounds good!
Yep, when you call processPayment again it should indicate that the PI is in a status of requires_capture and that you can't process it again.
Don't remember the exact response but should be relatively easy to test out.
Happy to help!
๐ฏ
Ah btw @rancid ore, this was Interac so it should actually let you know the PI is already succeeded (not requires_capture) in the response
I'd test with both Interac and VISA/MC so you know how to correctly handle the responses
Haha yuppp! I do have another check in place that does test for either 'requires_capture', or 'succeeded' when it's Interac, because sometimes the internet speeds at these places goes as low as 2MB/sec during high traffic - so I can definitely check both in our backup sequence for an error code 30 case
Thanks for pointing it out though! I appreciate it ๐
Awesome! Will do!