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

TerminalConnectTypes.Internet doesn't work for browser app #381

Open
2 of 8 tasks
kyleabens opened this issue Aug 30, 2024 · 8 comments
Open
2 of 8 tasks

TerminalConnectTypes.Internet doesn't work for browser app #381

kyleabens opened this issue Aug 30, 2024 · 8 comments
Labels

Comments

@kyleabens
Copy link

kyleabens commented Aug 30, 2024

Platform

  • Web
  • iOS
  • Android

Describe the bug
Using TerminalConnectTypes.Internet does not work for ionic apps in the browser. Seems to only work for iOS or Android apps.

Expected behavior
This should be possible on the browser

await StripeTerminal.discoverReaders({
    type: TerminalConnectTypes.Internet,
    locationId: ***********
 });

Using Function:

  • Payment Sheet / Payment Flow
  • Apple Pay
  • Google Pay
  • Identity (@capacitor-community/stripe-identity)
  • Terminal(@capacitor-community/stripe-terminal)
@rdlabo
Copy link
Member

rdlabo commented Aug 30, 2024

Please check out our demo.It has been available on the Web since v6.2.0.
https://github.com/capacitor-community/stripe/releases/tag/v6.2.0

@kyleabens
Copy link
Author

@rdlabo I'm having a hard time seeing if I need to add something else for it work on web. I'm on v6.2.1 and I can confirm the below promise never resolves or throws an error.

await StripeTerminal.discoverReaders({
    type: TerminalConnectTypes.Internet,
    locationId: ***********
 });

@kyleabens
Copy link
Author

Could it be because TerminalEventsEnum.RequestedConnectionToken listener never fires after await StripeTerminal.initialize({ isTest: false }) ?

@rdlabo
Copy link
Member

rdlabo commented Aug 30, 2024

First, this “Expect Happy Path - Internet” can discover the device (it's my device at hand, so it's offline).

https://capacitor-community-stripe.netlify.app/tabs/terminal

I can guess that the locationId is wrong, the token is wrong, etc., but I confirm that the plugin itself works.

@kyleabens
Copy link
Author

Where can I see the code for that specific "Expect Happy Path - Internet" demo ? I can never get it to fire on the browser but I can on the app.

@rdlabo
Copy link
Member

rdlabo commented Oct 25, 2024

Sorry for late. Demo code is be at this repository:
https://github.com/capacitor-community/stripe/tree/main/demo/angular

@shiv19
Copy link
Contributor

shiv19 commented Nov 22, 2024

@kyleabens It might be that issue #407 happens on web too where Stripe SDK might actually call onFetchConnectionToken twice after initialize and this plugin currently can only handle 1 call to RequestedConnectionToken when tokenProviderEndpoint has not been specified.

Do you still need help with this?

@rdlabo
Copy link
Member

rdlabo commented Dec 5, 2024

@kyleabens The latest version of #407 solves this problem, so this problem may be solved. Please try the latest version once.

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

No branches or pull requests

3 participants