capacitor-community / stripe

Stripe Mobile SDK wrapper for Capacitor

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

readCancelled on collecting second payment.

divyesh-savaliya opened this issue · comments

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)

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.

commented

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