#stratopedarx-swift-terminal
1 messages ยท Page 1 of 1 (latest)
looks like your backend is probably returning an error to me.
i.e. this error I think happens if your call to get a connection token fails https://github.com/stratopedarx/TestSwiftUIStripeTerminal/blob/93bced79051a48db92d7e47b798c2a471bbf10fb/TestSwiftUIStripe/APIClient.swift#L12-L43 (that's why it says "token_provider_returned_error")
I'd start by adding some logging and breakpoints in that part of the code to see what gets returned and how the code executes.
but I think you deployed this to heroku : https://github.com/stripe/example-mobile-backend ; but for Terminal you should be using https://github.com/stripe/example-terminal-backend instead.
I'm sorry. Could you check it with the following endpoint https://orion-stripe-test.herokuapp.com/
Instead of that
or if it is possible to start the service locally.
I get the correct secret token. But after that, I don't end up in the delegate method. Nothing happens.
Apologies for the delay, just trying to align on where this currently is. So you're getting a connection token, was that already working or did you need to make a change to accomplish that?
Hello,
The token is working. It is stripe's test token.
https://github.com/stratopedarx/TestSwiftUIStripeTerminal
if you download this sample SwiftUI app and put a breakpoint like in the screenshot below, you will see that you will not get there. And I don't understand why this is happening. If you make exactly the same application on UIKIt, then everything works.
TestSwiftUIStripe.zip - there is discoverReaders doesn't work correctly. the same ( https://github.com/stratopedarx/TestSwiftUIStripeTerminal)
StripeTerminalTestTest - UIkit. Everything works correctly.
It looks like the way we create the project in xcode affects how StripeTerminal works.
๐ I'm hopping in to take a look! Give me a few minutes
When you switched to the different endpoint, are you seeing hte same logs as before?
@unique hinge I'm catching up here, full disclosure, I'm not great with SwiftUI but have UIKit experience so can try to piece together an understanding
give me a bit to catch up
looking through your code now, give me a bit (I'm also in other threads)
1/ your code runs discoverReaders() here right?
https://github.com/stratopedarx/TestSwiftUIStripeTerminal/blob/main/TestSwiftUIStripe/Manager.swift#L33
2/ and does that completion block ever get hit?
thanks for the video, that was helpful
one thing I'm confused about - why did your fetchConnectionToken function get triggered? that should trigger when you call connectReader() , after discoverReaders(), no?
so how did that trigger?