#ash_code
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1352690165243445308
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ash_code, 1 day ago, 15 messages
- ash_ongoing-support-case, 2 days ago, 39 messages
- ash_code, 2 days ago, 150 messages
- ash_code, 3 days ago, 5 messages
Hello ๐
Can you share details about what you mean by "do another payment"? Are you retrieving a new Payment Intent?
So what i mean is ->
my flow is actualy like this:
-> initialise terminal
-> discover readers based on handoff configuration
-> and do the payment flow.. which is creating payment intent, authorizing and capturing the payment
I do a complete payment successfully, now I try to do one more transaction, so i try to initialise the terminal again and discover the reader, then it shows the exception.
once i exit out of a successul transaction, it prints the exception i posted
Sorry, I am confused. shouldn't you have already exited out of the successful transaction before you attempt to create another transaction?
sorry for bad clarity
yes i exit
then right that instant, the above exception gets printed in my console
and even if that exception is there, i try to another transacation for which i discover readers again
it never discovers reader
and shows above exception
Okay so you exit from the first successful Payment and you see the above error?
This happens before you attempt a second payment?
answer to both : yes
Okay so we can essentially ignore the success/failure of the payments. That helps me narrow down where things might be going wrong.
when transaction fails
i dont get this
only when a transaction is sucesful
successful*
Okay so if your first payment is not successful, you do not see this error?
correct
Okay, thats weird
i dont know if something got fixed from the backend cus the payment flow which was failing for for the last 3 days
suddenly started working since yesterday
did ur team make any changes
?
cus i didnt get any response from terminal team on this?
We release firmware updates pretty regularly for our readers but I am not aware of any specific fix for the issue you were experiencing.
i m not sure if its a firmware fix
if u have access to my older chats
u can see the exception i used to get
Just so I am clear, this error is returned when control comes back to your code in the app? You perform the handoff we document here
Looking at the connectReader function below:
private fun connectReader(reader: Reader) {
Terminal.getInstance().connectReader(
reader,
HandoffConnectionConfiguration(
object : HandoffReaderListener {
override fun onDisconnect(reason: DisconnectReason) {
// Optionally get notified about reader disconnects (for example, reader was rebooted)
}
override fun onReportReaderEvent(event: ReaderEvent) {
// Optionally get notified about reader events (for example, a card was inserted)
}
}
),
object : ReaderCallback {
override fun onSuccess(reader: Reader) {
// Handle successfully connecting to the reader
}
override fun onFailure(e: TerminalException) {
// Handle exception when connecting to the reader
}
}
)
}
Can you tell me which callback is receiving the error?
so we wrote a plugin on top of the android code
the issue is only happening with handoff mode
when i do the a tap to pay or bluetooth payments
i dont have this issue after sucessful payments
this happened 3 days back too.. my initial question
yes i use this code in my android code
If you are uisng this code, where is the exception raised?
override fun onFailure(e: TerminalException) {
// Handle exception when connecting to the reader
}
Okay great, thanks!
Can you also share the Kotlin function for collecting payment info, like what we show here?
sure
2 mins pls
override fun onStartCollectPaymentMethod(
result: Result<PaymentIntentApi>,
operationId: Long,
paymentIntentId: String,
requestDynamicCurrencyConversion: Boolean,
surchargeNotice: String?,
skipTipping: Boolean,
tippingConfiguration: TippingConfigurationApi?,
shouldUpdatePaymentIntent: Boolean,
customerCancellationEnabled: Boolean
) {
val paymentIntent = findPaymentIntent(paymentIntentId)
val config =
CollectConfiguration.Builder()
.setSurchargeNotice(surchargeNotice)
.setRequestDynamicCurrencyConversion(requestDynamicCurrencyConversion)
.skipTipping(skipTipping)
.setTippingConfiguration(tippingConfiguration?.toHost())
.updatePaymentIntent(shouldUpdatePaymentIntent)
.setEnableCustomerCancellation(customerCancellationEnabled)
.setAllowRedisplay(AllowRedisplay.ALWAYS)
cancelablesCollectPaymentMethod[operationId] =
terminal.collectPaymentMethod(
paymentIntent,
config = config.build(),
callback =
object : TerminalErrorHandler(result::error), PaymentIntentCallback {
override fun onFailure(e: TerminalException) {
cancelablesCollectPaymentMethod.remove(operationId)
super.onFailure(e)
}
override fun onSuccess(paymentIntent: PaymentIntent) {
cancelablesCollectPaymentMethod.remove(operationId)
result.success(paymentIntent.toApi())
paymentIntents[paymentIntent.id!!] = paymentIntent
}
}
)
}
this is what i have in my terminal.kt file
Just as a test, could you attempt to replace your more thorough method with what we provide in our example app that I linked? That way we can see if it's related to the other things you have going on here.
this is the method we are using for collecting payment info
Hi, thanks for joining
onStartCollectPaymentMethod
this is the method we are trying to call
to collect payments
Right, but did you do what my colleague suggested above?
we wrote a flutter plugin on top of the android code, when i debug it doesnt call this
internal code
but i shared what we have in our kotlin code
Sorry I don't think we're going to be able to get this figured out in Discord
We juggle too many threads in here
And turn over is too high on who's looking into each issue
At this point I think you need to write in and open up a support ticket so you can get more one-on-one assistance on this