Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction timeout not reported to app #374

Closed
superafroman opened this issue Sep 25, 2023 · 9 comments
Closed

Transaction timeout not reported to app #374

superafroman opened this issue Sep 25, 2023 · 9 comments

Comments

@superafroman
Copy link

Summary

After call collectPaymentMethod the card reader will stay active for an hour waiting for a card to be tapped or inserted and payment to be completed. If this doesn't happen at the 1 hour mark the reader will timeout. This isn't being reported to our app. I can see the event in the logs but never receive any callback or exception related to it. The result of this is that the card reader becomes inactive (no longer awaiting a payment method) but the app continues to think everything is OK.

I've added some logs at the bottom of this issue.

It would be great to have this fixed, but I would also like to know if it's possible this timeout could be removed, or made configurable? 1 hour seems fairly arbitrary - certainly for our use case we either want the timeout to be ~60 seconds (if someone hasn't paid by then they aren't going to) or we want it to never timeout (e.g. a reader, active, waiting for someone to tap to donate).

Code to reproduce

Call Terminal.getInstance().collectPaymentMethod(...) and wait an hour ... 😅

Android version

So far tested on Android 9 and 12

Impacted devices (Android devices or readers)

WisePad 3

SDK version

3.0.0

Other information

This seems to be the same issue as previously reported here: #17

Logs

2023-09-22 13:30:25.584 16967-16967 StripeTerminal co.givealittle.kiosk I class=BbposPaymentCollectionListener message="onReturnTransactionResult TIMEOUT"
2023-09-22 13:30:25.595 16967-16967 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionCoordinator message="onHandlePaymentCollectionEvent TransactionCompletedEvent(result=TERMINATED)"
2023-09-22 13:30:25.597 16967-17447 StripeTerminal co.givealittle.kiosk I class=StageEventLogger message="KernelProcessing newStatus IDLE event TransactionCompletedEvent"
2023-09-22 13:30:25.600 16967-17447 StripeTerminal co.givealittle.kiosk I class=StageEventLogger message="Reporting CardPresent outcome com.stripe.jvmcore.loggingmodels.Outcome$GenericError@9072a8 tags {PaymentMethodType=UNKNOWN, TransactionType=CHARGE, EmvTransactionType=TRADITIONAL, LatencyCategory=USER_ACTION, CardPresentFailureReason=UNKNOWN}"
2023-09-22 13:30:25.603 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionCoordinator message="onHandlePaymentCollectionEvent com.stripe.core.paymentcollection.ClearMagStripeStateEvent@66031c1"
2023-09-22 13:30:25.604 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionStateMachine message="onStateChanged: COLLECTION -> PREPARE_TO_COLLECT_AGAIN: Error in collection. Prepare to collect again."
2023-09-22 13:30:25.614 16967-17447 StripeTerminal co.givealittle.kiosk I class=EndToEndEventLogger message="Payment collection metric ending in 3600726 ms: result FAILURE, tagMap {PaymentMethodType=UNKNOWN, TransactionType=CHARGE, EmvTransactionType=TRADITIONAL, CollectionFailureReason=READER_TERMINATED}"
2023-09-22 13:30:25.621 16967-17447 StripeTerminal co.givealittle.kiosk I class=EndToEndEventLogger message="Category USER_ACTION took 3599930 ms."
2023-09-22 13:30:25.628 16967-17447 StripeTerminal co.givealittle.kiosk I class=EndToEndEventLogger message="Category KERNEL_PROCESSING took 395 ms."
2023-09-22 13:30:25.633 16967-17447 StripeTerminal co.givealittle.kiosk I class=EndToEndEventLogger message="Category POS_COMMAND_DELAY took 0 ms."
2023-09-22 13:30:25.638 16967-17447 StripeTerminal co.givealittle.kiosk I class=EndToEndEventLogger message="Category NETWORK_PROCESSING took 0 ms."
2023-09-22 13:30:25.643 16967-17447 StripeTerminal co.givealittle.kiosk I class=EndToEndEventLogger message="Category UNKNOWN took 433 ms."
2023-09-22 13:30:25.643 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionStateMachine message="onStateChanged: PREPARE_TO_COLLECT_AGAIN -> RECOVERABLE_ERROR_SUMMARY: Transaction can be recovered."
2023-09-22 13:30:25.645 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionStateMachine message="onStateChanged: RECOVERABLE_ERROR_SUMMARY -> COLLECTION: Ready to collect again - does not control input."
2023-09-22 13:30:25.646 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionCoordinator message="onHandlePaymentCollectionEvent ConfigureReaderEvent(configuration=ReaderConfiguration(readersEnabled=[ICC, NFC], transactionAmount=Amount(value=1000, currency=GBP), transactionType=GOODS, emvTransactionType=TRADITIONAL, quickChipMode=USE_CONFIG, terminalCapabilitiesOverride=null, domesticDebitPriority=null, contactlessOnlinePinOption=null))"
2023-09-22 13:30:25.647 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionCoordinator message="onHandlePaymentCollectionEvent PresentPaymentMethodEvent(model=CollectionModel(transactionType=CHARGE, amount=Amount(value=1000, currency=GBP), baseAmount=Amount(value=1000, currency=GBP), callToAction=null, readerActiveInterfaces=[ICC, NFC], readerContactCardSlotState=EMPTY, readerEnableEditTip=false, enableCustomerCancellation=false))"
2023-09-22 13:30:25.649 16967-17447 StripeTerminal co.givealittle.kiosk I class=StageEventLogger message="KernelProcessing newStatus BUSY event ConfigureReaderEvent"
2023-09-22 13:30:25.649 16967-17447 StripeTerminal co.givealittle.kiosk I class=StageEventLogger message="Starting event KernelProcessing with latencyCategory KERNEL_PROCESSING"
2023-09-22 13:30:25.657 16967-17447 StripeTerminal co.givealittle.kiosk D class=BbposDeviceControllerImpl message=startEmv
2023-09-22 13:30:25.665 16967-17447 StripeTerminal co.givealittle.kiosk D class=BbposAdapterPaymentCollectionListener message=onRequestPaymentMethodCollection
2023-09-22 13:30:25.666 16967-17447 StripeTerminal co.givealittle.kiosk I class=TerminalStatusManager message="requestReaderInput Insert / Tap."
2023-09-22 13:30:25.666 16967-17447 StripeTerminal co.givealittle.kiosk I class=ProxyReaderListener message="onRequestReaderInput(Insert / Tap)"
2023-09-22 13:30:25.666 16967-17447 StripePaymentSession co.givealittle.kiosk D onRequestReaderInput: Insert / Tap
2023-09-22 13:30:25.723 16967-16967 StripeTerminal co.givealittle.kiosk I class=BbposControllerListener message="onError DEVICE_BUSY, Device busy with command/callback: onWaitingForCard"
2023-09-22 13:30:26.648 16967-16967 StripeTerminal co.givealittle.kiosk I class=BbposPaymentCollectionListener message="onReturnCheckCardResult NO_CARD cardData CardData{}"
2023-09-22 13:30:26.649 16967-16967 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionCoordinator message="onHandlePaymentCollectionEvent ContactCardUpdateEvent(updatedCardState=EMPTY)"
2023-09-22 13:30:26.651 16967-17447 StripeTerminal co.givealittle.kiosk I class=StageEventLogger message="KernelProcessing newStatus IDLE event ContactCardUpdateEvent"
2023-09-22 13:30:26.652 16967-17447 StripeTerminal co.givealittle.kiosk I class=StageEventLogger message="Reporting KernelProcessing outcome com.stripe.jvmcore.loggingmodels.Outcome$Ok@ebc1124 tags {PaymentMethodType=UNKNOWN, TransactionType=CHARGE, KernelProcessingResult=ContactCardUpdateEvent, EmvTransactionType=TRADITIONAL, LatencyCategory=KERNEL_PROCESSING}"
2023-09-22 13:30:26.654 16967-17447 StripeTerminal co.givealittle.kiosk I class=PaymentCollectionCoordinator message="onHandlePaymentCollectionEvent PresentPaymentMethodEvent(model=CollectionModel(transactionType=CHARGE, amount=Amount(value=1000, currency=GBP), baseAmount=Amount(value=1000, currency=GBP), callToAction=null, readerActiveInterfaces=[ICC, NFC], readerContactCardSlotState=EMPTY, readerEnableEditTip=false, enableCustomerCancellation=false))"
2023-09-22 13:30:26.656 16967-17447 StripeTerminal co.givealittle.kiosk D class=BbposAdapterPaymentCollectionListener message=onRequestPaymentMethodCollection
2023-09-22 13:30:26.656 16967-17447 StripeTerminal co.givealittle.kiosk I class=TerminalStatusManager message="requestReaderInput Insert / Tap."
2023-09-22 13:30:26.656 16967-17447 StripeTerminal co.givealittle.kiosk I class=ProxyReaderListener message="onRequestReaderInput(Insert / Tap)"
2023-09-22 13:30:26.657 16967-17447 StripePaymentSession co.givealittle.kiosk D onRequestReaderInput: Insert / Tap
2023-09-22 13:30:28.375 16967-16967 StripeTerminal co.givealittle.kiosk I class=BbposPaymentCollectionListener message="onRequestDisplayText SHOW_THANK_YOU"
2023-09-22 13:30:30.463 16967-17198 QueueFileCollector co.givealittle.kiosk V terminal_sdk_wire_metrics batch of size 11 generated.
2023-09-22 13:30:31.159 16967-16967 BatchDispatcher co.givealittle.kiosk V Flushed successfully.
2023-09-22 13:30:31.164 16967-17198 QueueFileCollector co.givealittle.kiosk V terminal_sdk_wire_metrics removed 11 entries.
@chr-stripe
Copy link
Collaborator

Hi @superafroman, I tested this locally and was unable to reproduce the issue where the reader is unresponsive after the 1 hour timeout. I had tried this on the latest SDK available – please let me know if you're still seeing the reader unresponsive after waiting for an hour. If you're able to share a Payment Intent ID after reproducing this as well, that would be helpful for us to check our internal logs.

As for changing the timeout, unfortunately we have no immediate plans to do so. However, you should be able to replicate a shorter timeout by starting a timer within your app when beginning to collect a payment, and call cancel() on the Cancelable returned by Terminal.collectPaymentMethod(). This allows you to customize the timeout for now; we may explore possibilities for allowing the collection timeout to be customizable in the future.

@superafroman
Copy link
Author

Hi @chr-stripe, the issue isn't that the reader becomes unresponsive, it's that our app is not notified that the payment has timed out.

@cnhuz
Copy link

cnhuz commented Feb 20, 2024

Same error. There is no such issue for Reader M2.

@chr-stripe
Copy link
Collaborator

Hi all, thank you for the bug report. This will be addressed in our next SDK release, which should be available in the coming weeks. Starting in SDK 3.5.0, if a payment method is not presented after an hour to the reader, payment collection will fail with a CARD_READ_TIMED_OUT error. At that point you are still free to restart payment collection if necessary.

As with before, you may enforce a shorter timeout by starting a timer within your app when beginning to collect a payment, and calling cancel() on the Cancelable returned by Terminal.collectPaymentMethod().

I'll update this thread once 3.5.0 is available.

@billfinn-stripe
Copy link
Collaborator

Hi all -- release 3.5.0 is now available. Please upgrade and see if this is still a problem. I'm going to optimistically close this issue, but feel free to reopen if you're still experiencing problems.

@Noitidart
Copy link

I was intentionally hoping to let the collect hang indefinitely. Is this possible in any of the 3.x versions? Is it possible to extend the 1hr timeout?

@billfinn-stripe
Copy link
Collaborator

Hi @Noitidart -- no, that's currently not possible in part due to PCI requirements.

@Noitidart
Copy link

Got it, thanks for your fast reply.

@Noitidart
Copy link

@billfinn-stripe - just wanted to share what I was trying to use Stripe to make, its this tap to give:

image

So right now my limitation is every 1hr I have to refresh it, an during that 5sec refresh, if a user shows up, it could cause some user experience issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants