stripe / stripe-terminal-ios

Stripe Terminal iOS SDK
https://stripe.com/docs/terminal/sdk/ios
Other
105 stars 65 forks source link

Unexpected SDK error 5107 #292

Closed jongbelegen closed 8 months ago

jongbelegen commented 8 months ago

Summary

On our staging environment, we are experiencing the following error when I run de SDK and want to connect to a terminal. Coincidently this issue arised after we got a custom terminal picture (so when you start up the Wisepad 3 you can see a image of our company instead of the stripe image). The SDK first tries to update the wisepad and at the end when it tries to connect it fails:

[StripeTerminal] e scope=SCPTerminal event=connectReader logpoint_level=info account=acct_1LMVs5FUuBdpWW24 app_id={{REDACTED}}.stripe-terminal-example error=An_unexpected_SDK_error_occurred error_code=5107 error_domain=com.stripe-terminal exception=UNEXPECTED_ERROR.UnexpectedSdkError last_request_id=req_SM3EqFwunxEppY reader=tmr_FV8KbQGfn0jexZ sdk_version=3.3.1 time=1709570526589 total_time_ms=4438
[StripeTerminal] x scope=scpterminal event=connectreader domain=terminal_request outcome=error_code_5107 time=1709570526603

When I try to connect it again it immediately gives me this error.

The interesting thing is that this is not happening in our stripe production environment (livemode) but only in testmode (luckily).

Code to reproduce

I cloned the example app, changed the URL path and set a location stub:

+++ b/Example/Example/AppDelegate.swift
@@ -22,7 +22,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {

      static var backendUrl: String? = "https://your-app.herokuapp.com"
      */
-    static var backendUrl: String?
+    static var backendUrl: String? = "https://{{ REDACTED }}/api/stripe-terminal"
+++ b/Example/Example/ReaderDiscoveryViewController.swift
@@ -44,6 +44,7 @@ class ReaderDiscoveryViewController: TableViewController, CancelableViewControll
     private let onBehalfOfTextField = TextFieldView(placeholderText: "On behalf of account ID (optional)")

     init(discoveryConfig: DiscoveryConfiguration) {
+        self.selectedLocationStub = LocationStub(stripeId: "{{ RECACTED }}", displayName: "Hardcoded stub")

iOS version

17.2.1 (Also happens with 16.2)

Installation method

Cloned example app

SDK version

3.3.1

I suspect it has something to do with our custom configuration (the boot picture that is loaded).

bric-stripe commented 8 months ago

Hi, I can confirm this error is from the image attempting to be installed. It's too small 🤔 Investigating now but was the image recently updated?

bric-stripe commented 8 months ago

OK, the team made sense of things here. In testmode there was still an old/bad image. That's been fixed now. Re-open if still seeing issues though.

jongbelegen commented 8 months ago

Thanks, it works great!