You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am implementing Stripe Terminal on iOS. When processing a valid card from my M2 reader, it works great.
If there is an error in my transaction, I have added a "try again" button that just starts the payment capture process over: fetchPaymentIntent => retrievePaymentIntent => collectPaymentMethod (code below) . If I remove the card before "trying again", everything works fine.
But if I leave the card in the M2 reader (such that the beeping reminders start to sound), and then attempt to run the code below, the app becomes unresponsive at Terminal.shared.collectPaymentMethod. No errors are thrown in output and the completion method isn't called.
I have tried to figure out a way to test if the card is still in the reader to throw a "remove card please" message before the code below is run again but I haven't been able to find anything in the API reference.
Here's my collect payment code:
func collectPayment() {
StripePayment.shared.fetchPaymentIntent(totalCart: totalCart) { createResult, createError in
if let error = createError {
self.throwPaymentError(error)
} else if let clientSecret = createResult {
Terminal.shared.retrievePaymentIntent(clientSecret: clientSecret) { (intent, error) in
if let retrieveError = error {
self.throwPaymentError(retrieveError)
} else if let retrievedIntent = intent {
self.collectCancelable = Terminal.shared.collectPaymentMethod(retrievedIntent) { collectResult, collectError in
self.readerMessageLabel.text = "Processing Payment"
if let error = collectError {
self.throwPaymentError(error)
} else if let paymentIntent = collectResult {
self.processPayment(paymentIntent)
}
}
}
}
}
}
}
The text was updated successfully, but these errors were encountered:
@benhill thanks for the report! Just confirming we've been able to reproduce and are investigating further. So far we've identified that this is a regression in version 2.3.0. Version 2.2 correctly fails the second collectPaymentIntent call with the expected CardLeftInReader error.
is there a way to identify that a card has been left in the reader via the API
there's not currently a great way to do this. One option is to track the state via the didReportReaderEvent. If you receive a CardInserted event is sent, when the transaction is complete, if you haven't received the CardRemoved event, you could update your UI to request the card be removed until you receive that CardRemoved event.
note we're still investigating this regression and will need to do a full release test but we're likely going to release a 2.9.1 with a bugfix for this issue. No definite timeline but I'm hopeful for early next week. With that fix if the card was left in the reader the second collectPaymentMethod call will fail right away with the CardLeftInReader error, which is the expected behavior for this.
I am using StripeTerminal (2.8.0)
I am implementing Stripe Terminal on iOS. When processing a valid card from my M2 reader, it works great.
If there is an error in my transaction, I have added a "try again" button that just starts the payment capture process over: fetchPaymentIntent => retrievePaymentIntent => collectPaymentMethod (code below) . If I remove the card before "trying again", everything works fine.
But if I leave the card in the M2 reader (such that the beeping reminders start to sound), and then attempt to run the code below, the app becomes unresponsive at Terminal.shared.collectPaymentMethod. No errors are thrown in output and the completion method isn't called.
I have tried to figure out a way to test if the card is still in the reader to throw a "remove card please" message before the code below is run again but I haven't been able to find anything in the API reference.
Here's my collect payment code:
The text was updated successfully, but these errors were encountered: