#alex.f-iOS-terminal
1 messages · Page 1 of 1 (latest)
Hi @sand badger Thanks!
Thank you for your patience while I consult with teammates on this. Could you provide us with your account ID, or if you're seeing a request that is failing then that request's ID (req_XXX) would be helpful?
I don't know the account ID, it's the account of my customer. I have some logs:
2022-01-20 17:00:02.184704+0200 Scope[48231:17122602] [StripeTerminal] l api_endpoint=terminal.connection_tokens.generate_pos_rpc_session app_id=net.scopeapp.ios.companion event=api_request_post logpoint_level=info scope=SCPAPIRequest sdk_version=2.4.0 time=1642690802184
2022-01-20 17:00:02.190961+0200 Scope[48231:17122602] [StripeTerminal] l api_endpoint=terminal.connection_tokens.activate app_id=net.scopeapp.ios.companion event=api_request_post logpoint_level=info scope=SCPAPIRequest sdk_version=2.4.0 time=1642690802190
2022-01-20 17:00:02.374625+0200 Scope[48231:17122599] [boringssl] boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics
2022-01-20 17:00:02.382232+0200 Scope[48231:17123277] [boringssl] boringssl_metrics_log_metric_block_invoke(151) Failed to log metrics
2022-01-20 17:00:02.439617+0200 Scope[48231:17122602] [StripeTerminal] l api_endpoint=terminal.connection_tokens.generate_pos_rpc_session app_id=net.scopeapp.ios.companion error=could_not_parse_json_from_body event=api_response_error http_method=POST http_status_code=401 logpoint_level=info scope=SCPAPIRequest sdk_version=2.4.0 time=1642690802438
2022-01-20 17:00:02.440715+0200 Scope[48231:17122602] [StripeTerminal] x domain=api_request event=post_terminal_connection_tokens_generate_pos_rpc_session outcome=http_status_code_401 scope=scpterminal time=1642690802441
2022-01-20 17:00:02.446202+0200 Scope[48231:17122600] [StripeTerminal] l api_endpoint=terminal.connection_tokens.activate app_id=net.scopeapp.ios.companion error=could_not_parse_json_from_body event=api_response_error http_method=POST http_status_code=401 logpoint_level=info scope=SCPAPIRequest sdk_version=2.4.0 time=1642690802445
According this logs next endpoint fails: api_endpoint=terminal.connection_tokens.generate_pos_rpc_session
Hm, do you have a firewall or proxy that could be altering the messages from Stripe?
do you have a PaymentIntent ID pi_xxxx for example? just so we can look at logs on our side for the related account.
in any case I see the error looks like a 401 which is about authentication so maybe there's some sort of issue with how you set up your app to use the ConnectionToken your backend returns(https://stripe.com/docs/terminal/payments/setup-sdk?terminal-sdk-platform=ios#initialize), or you didn't do that part? More context on your integration would help a lot
Hey @night timber My backend returns the connection token (pst_test_YWNjdF8xOUptb2VJVWpub3hWN21HLDRaaVpNSmZpQ2JjUXZjUkFqaWxSZUF5d0hqdjFOZ2I_000vyzqGjT) and the app have implementation of the ConnectionTokenProvider protocol. Also I initialised SDK with the ConnectionTokenProvider. The app discovers simulated readers but I can't connect to any of them.
I've asked my customer for account ID. I will provide it when he answered me.
Hey @sand badger no, I don't have firewall and proxy.
yeah that's pretty weird, not sure we've ever seen this specific type of failure. Hmm.
nothing on our logs for that account(the key is enough to find it) that I can find.
I feel like what would help is seeing the exact actual response the SDK is trying to parse but I'm unsure how exactly how you'd see that.
we do have an internal issue open right now we're investigating and I wonder if it's related. Two questions : a) have you been able to use this same integration on other Stripe accounts? b) have you just started building this integration/seeing these errors today or how long has it been happening?
have you been able to use this same integration on other Stripe accounts?
no, it's my first time when I implements Stripe Terminal SDK
have you just started building this integration/seeing these errors today or how long has it been happening?
this has been going on for at least 3 days
Thanks for your help!
hmm ok not related to what I was thinking then.
I wonder if you can do https://useyourloaf.com/blog/inspecting-http-traffic-with-instruments/ and see what is returned to the call to '/v1/terminal/connection_tokens/generate_pos_rpc_session' (if there is one). Though I can't get that to work on my device , maybe you would have more luck.
Hey @night timber I've sniff the traffic: https://gist.github.com/zerospace/d4c26e85e507e5fefd7831965f65ef11
So the error is in the invalid connection token
oh nice, that's very helpful
Hello! Looking at those requests and responses the quotes around the key jump out at me. Are there actually quotes around the key itself? Meaning the value of the key is "pst_..." instead of pst_?
oh, good catch
Hey @frosty granite I don't know, the code is hidden in the framework.
No, this would be code you control.
the code is, but the string for that key comes from what you pass to the completion block inside your fetchConnectionToken implementation, which you can log