stripe-terminal-react-native
stripe-terminal-react-native copied to clipboard
cancelPaymentIntent doesn’t cancel a payment in the requiresCapture state
Describe the bug
When calling cancelPaymentIntent with a valid payment intent ID for a payment intent in the requiresCapture
state, the SDK returns this response object:
{"error": {"code": "InvalidRequiredParameter", "message": "There is no associated paymentIntent with id pi_xxxxxxxxxx"}, "paymentIntent": undefined}
Before calling the cancel method the payment intent is visible in the Stripe dashboard (in test mode) and I am definitely passing the correct payment intent ID. The payment intent I am trying to cancel is in the requiresCapture
state. Canceling a payment works for payments in the requiresPaymentMethod
state.
To Reproduce Steps to reproduce the behavior:
- Create a payment intent, tap/swipe the card and proceed until the payment intent is in the
requiresCapture
state. - Attempt to cancel the payment intent by calling cancelPaymentIntent(...) with the payment intent ID.
Expected behavior The payment intent is canceled.
Smartphone (please complete the following information):
- iPad 6
- Stripe Reader M2
- "@stripe/stripe-react-native": "0.28.0",
- "@stripe/stripe-terminal-react-native": "^0.0.1-beta.11",
Do you have a Payment Intent ID or a request ID that we can look closer at?
Sure. pi_3P1snBDLXVGdoDbn1wYFlVqI
. We can cancel this payment intent using the web API. It’s only the react native terminal SDK cancelPaymentIntent
method that fails with the error response above. I can’t see the terminal SDK’s cancel attempt in the stripe dashboard so perhaps the terminal SDK isn’t even making a web request. I also don’t think it's a timing issue since I already see the payment intent in the dashboard before I attempt to cancel it using the terminal SDK. I’d be happy to hop on a call and demonstrate the problem if that helps.
Can you try upgrading to the latest release (17)?
I believe this error was fixed (or at least changed) as part of https://github.com/stripe/stripe-terminal-react-native/pull/551.
hey @marvinklein did you get a chance to test this on the latest release?
Closing this due to inactivity, feel free to open a issue if the issue still persists