#ash_code

1 messages ยท Page 1 of 1 (latest)

round plankBOT
#

๐Ÿ‘‹ 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.

split crow
#

Hello ๐Ÿ‘‹

Can you share details about what you mean by "do another payment"? Are you retrieving a new Payment Intent?

round plankBOT
hard fiber
#

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

split crow
#

Sorry, I am confused. shouldn't you have already exited out of the successful transaction before you attempt to create another transaction?

hard fiber
#

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

split crow
#

Okay so you exit from the first successful Payment and you see the above error?

This happens before you attempt a second payment?

hard fiber
#

answer to both : yes

split crow
#

Okay so we can essentially ignore the success/failure of the payments. That helps me narrow down where things might be going wrong.

hard fiber
#

when transaction fails

#

i dont get this

#

only when a transaction is sucesful

#

successful*

split crow
#

Okay so if your first payment is not successful, you do not see this error?

hard fiber
#

correct

split crow
#

Okay, thats weird

hard fiber
#

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?

split crow
#

We release firmware updates pretty regularly for our readers but I am not aware of any specific fix for the issue you were experiencing.

hard fiber
#

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

split crow
#

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?

hard fiber
#

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

hard fiber
split crow
#

If you are uisng this code, where is the exception raised?

hard fiber
#

override fun onFailure(e: TerminalException) {
// Handle exception when connecting to the reader
}

split crow
#

Okay great, thanks!

hard fiber
#

thankuu

#

pls let me know if u find something

split crow
#

Can you also share the Kotlin function for collecting payment info, like what we show here?

hard fiber
#

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

round plankBOT
split crow
#

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.

hard fiber
#

this is the method we are using for collecting payment info

bleak snow
#

Hi Snufkin had to head out

#

What do you mean exactly?

hard fiber
#

Hi, thanks for joining

#

onStartCollectPaymentMethod

#

this is the method we are trying to call

#

to collect payments

bleak snow
#

Right, but did you do what my colleague suggested above?

hard fiber
#

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

bleak snow
#

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