readCancelled on collecting second payment.
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)
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
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.
No, i did not disconnect reader because I want to keep it connected to accept multiple payments.
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.
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
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.
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.