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

readCancelled on collecting second payment. #346

Closed
2 of 8 tasks
divyesh-savaliya opened this issue Apr 12, 2024 · 7 comments
Closed
2 of 8 tasks

readCancelled on collecting second payment. #346

divyesh-savaliya opened this issue Apr 12, 2024 · 7 comments

Comments

@divyesh-savaliya
Copy link

Platform

  • Web
  • iOS
  • Android

Describe the bug
collectPaymentMethod failed while accepting another payment with error readCancelled

To Reproduce
First payment successful, when accepting payment again collectPaymentMethod failing with this error

Error (read): readCancelled
{"message":"The command was canceled.","errorMessage":"The command was canceled."}

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 Apr 13, 2024

Did you run StripeTerminal.disconnectReader() after first payment successful?

ex) https://github.com/capacitor-community/stripe/blob/main/demo/angular/src/app/terminal/terminal.page.ts#L345C11-L345C44

@rdlabo
Copy link
Member

rdlabo commented Apr 13, 2024

Note) In some cases, it may be more convenient to remain connected to the READER when making successive payments. For this reason, automatic disconnection is not performed.

@divyesh-savaliya
Copy link
Author

No, i did not disconnect reader because I want to keep it connected to accept multiple payments.

@rdlabo
Copy link
Member

rdlabo commented Apr 14, 2024

I have just tried it and it works fine at iOS.

(async ()=> {
  await StripeTerminal.initialize({ tokenProviderEndpoint: 'https://example.com/token', isTest: true })
  const { readers } = await StripeTerminal.discoverReaders({
    type: TerminalConnectTypes.TapToPay,
    locationId: "**************",
  });
  await StripeTerminal.connectReader({
    reader: readers[0],
  });

  // first payment
  await StripeTerminal.collectPaymentMethod({ paymentIntent: "**************" });
  await StripeTerminal.confirmPaymentIntent();

  // second payment
  await StripeTerminal.collectPaymentMethod({ paymentIntent: "**************" });
  await StripeTerminal.confirmPaymentIntent();

  await StripeTerminal.disconnectReader();
});

@divyesh-savaliya If you can't get it to work, give me a small reproduction code.

@yllaw
Copy link
Contributor

yllaw commented May 1, 2024

I am also running into this issue.

There is an issue on the official stripe ios github: stripe/stripe-terminal-ios#300

EDIT: What is odd is that sometimes it works but most of the time it will cancel

image

@yllaw
Copy link
Contributor

yllaw commented Jun 14, 2024

Hey all,

I believe this issue can be closed as it was a bug with iOS.

Per Stripe's official ios github: stripe/stripe-terminal-ios#300

....this is a known bug with iOS 17.4.1. It should be patched if you upgrade to iOS 17.5.

@rdlabo
Copy link
Member

rdlabo commented Aug 11, 2024

Thanks for doing the research. Perhaps I couldn't reproduce it because I checked on a different iOS. I will close it as it was not a plugin issue.

@rdlabo rdlabo closed this as completed Aug 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants