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
When I scan a card using collectPaymentMethod() first time it works fine. When then I call collectPaymentMethod() to discard the first card data and scan another one, I get this error:
CollectPaymentMethod was canceled by the user
Could anyone help me understand the cause of the issue? Thank you in advance!
Here is the function used to call collectPaymentMethod():
Code to reproduce
privatevar collectPaymentCancelable:Cancelable?=nullprivatevar intentInProcess:PaymentIntent?=nullfunscanCard(intentId:String, promise:Promise) {
if (!Terminal.isInitialized()) {
promise.reject("empty_token", "You must provide connection token first")
return
}
if (Terminal.getInstance().connectionStatus !=ConnectionStatus.CONNECTED) {
promise.reject("reader_disconnected", "You must connect to a reader first")
return
}
Terminal.getInstance().retrievePaymentIntent(intentId, object:PaymentIntentCallback {
overridefunonSuccess(paymentIntent:PaymentIntent) {
collectPaymentCancelable =Terminal.getInstance()
.collectPaymentMethod(paymentIntent, object:PaymentIntentCallback {
overridefunonSuccess(paymentIntent:PaymentIntent) {
collectPaymentCancelable =null
intentInProcess = paymentIntent
promise.resolve(serializeIntent(paymentIntent))
}
overridefunonFailure(e:TerminalException) {
collectPaymentCancelable =null
promise.reject("collect_failed", e.errorMessage)
}
})
}
overridefunonFailure(e:TerminalException) {
promise.reject("retrieve_fail", e.errorMessage)
}
})
}
Summary
When I scan a card using
collectPaymentMethod()
first time it works fine. When then I callcollectPaymentMethod()
to discard the first card data and scan another one, I get this error:Could anyone help me understand the cause of the issue? Thank you in advance!
Here is the function used to call
collectPaymentMethod()
:Code to reproduce
Android version
Android 12
Impacted devices (Android devices or readers)
Phone: Samsung Galaxy A13
Terminal: BBPOS Chipper X2
SDK version
Other information
Here is the relevant log:
The text was updated successfully, but these errors were encountered: