stripe icon indicating copy to clipboard operation
stripe copied to clipboard

readCancelled on collecting second payment.

Open divyesh-savaliya opened this issue 1 year ago • 6 comments

Platform

  • [ ] Web
  • [X] 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)
  • [X] Terminal(@capacitor-community/stripe-terminal)

divyesh-savaliya avatar Apr 12 '24 08:04 divyesh-savaliya

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 avatar Apr 13 '24 07:04 rdlabo

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.

rdlabo avatar Apr 13 '24 07:04 rdlabo

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

divyesh-savaliya avatar Apr 14 '24 04:04 divyesh-savaliya

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.

rdlabo avatar Apr 14 '24 07:04 rdlabo

I am also running into this issue.

There is an issue on the official stripe ios github: https://github.com/stripe/stripe-terminal-ios/issues/300

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

image

yllaw avatar May 01 '24 04:05 yllaw

Hey all,

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

Per Stripe's official ios github: https://github.com/stripe/stripe-terminal-ios/issues/300

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

yllaw avatar Jun 14 '24 16:06 yllaw

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 avatar Aug 11 '24 02:08 rdlabo