stripe-terminal-react-native
stripe-terminal-react-native copied to clipboard
When starting a payment using simulated reader, an expired API key is thrown
Describe the bug When starting a payment using simulated reader, an expired API key error is thrown. Error occurs sporadically and does not happen in every device. It happens very quickly if simultaneous payments are made.
To Reproduce Steps to reproduce the behavior:
- Start "StripeTerminalProvider" with a simulated reader.
- Error should occur sporadically.
- When trying again, the error is not thrown and Tap to Pay operation completes successfully.
Expected behavior Error should not occur, because it resolves automatically by trying again. I suspect that it is related to StripeTerminalProvider's token auto management.
Screenshots
Stripe Terminal React Native SDK version
-
^0.0.1-beta.14
Smartphone (please complete the following information):
- Device: iPhone 11
- OS: iOS 17.2.1
@brunoambr is this your simulated reader for Tap to Pay on iPhone? I wasn't able to repro it on my device. Can you try it out with the latest version 0.0.1-beta.15
or using our example or dev-app, and let us know if you run into the issue there as well?
@nazli-stripe Yes, it is my simulated reader (iPhone device). But it happens using an iOS simulator too.
I was able to reproduce using dev-app and 0.0.1-beta.15.
Steps to reproduce:
-
Run two projects instances (for example, a simulator and a physical device) and try to start a payment simultaneously (using the same API test key).
-
Sometimes, one of the readers will disconnect unexpectedly (it could happen at any step, I was able to reproduce while creating a payment intent or processing it) and the expired API key error should be the cause.
Maybe it will only happen when using a simulated reader? I wasn't able to reproduce without it.
Run two projects instances (for example, a simulator and a physical device) and try to start a payment simultaneously (using the same API test key).
Do you mean the same connection token? Each token is only supposed to be used with one instance. Your tokenProvider
should return a new ConnectionToken every time it's called
@nazli-stripe No, tokenProvider
function is implemented in back-end (.NET) as follows: Set up the connection token endpoint.
I was referring to Stripe's account key when (API test key) (StripeConfiguration.ApiKey) which is the same (because it is the same account).
I can confirm, after more tests, that this behavior is only happening when using Stripe's simulated reader.
Hello @brunoambr, I'm experiencing the same issue. After completing a payment and waiting for about one minute, attempting to make another payment results in the following error:
[Error: Expired API Key provided: pss_test_YW*********************************************************************_******kinr]
This consistently occurs after the mentioned time interval.
Did you manage to resolve this?
@Brunowilliang I'm not using the simulated reader anymore, so the error does not occur. I couldn't find another alternative.
Hi @brunoambr , we will be closing this ticket for now since we cannot reproduce. Feel free to reopen if this becomes a pressing issue again.