#zishaansunderji-terminal

1 messages ยท Page 1 of 1 (latest)

fresh mirage
#

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?

rancid ore
#

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
    }
}
fresh mirage
#

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)

rancid ore
#

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?

devout sentinel
#

๐Ÿ‘‹ stepping in for toby as they need to step away.

rancid ore
#

Hi, sounds good!

devout sentinel
#

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.

rancid ore
#

gotcha! okay perfect!

#

yeppp makes sense! Thanks a ton!!

#

This was super helpful!

devout sentinel
#

Happy to help!

rancid ore
#

๐Ÿ’ฏ

devout sentinel
#

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

rancid ore
#

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 ๐Ÿ™‚

devout sentinel
#

Makes sense!

#

Let us know if you run into any further issues!

rancid ore
#

Awesome! Will do!