Describe the bug
If the user presses the close button in the Google Pay interface, GooglePayEventsEnum.Canceled is not emitted nor is any error thrown. In my experience only the events GooglePayEventsEnum.Loaded and GooglePayEventsEnum.Completed work.
This bug seems to be present in the demo as well.
It should at the very least throw an unknown error: right now it appears that the Promise is never resolved or rejected
I have not tested with Apple Pay as I have not set it up yet, but this problem could be relevant to it as well.
Expected behavior
I expect an event to be emitted when user deliberately closes the Google Pay interface, either via the close button or clicking outside of the modal.
If resolving the Promise with a specific event is not possible, at least throw an error so async logic can complete. Code such as
const { paymentResult } = await stripe.presentGooglePay();
if (paymentResult !== GooglePayEventsEnum.Completed) {
throw new Error(ERROR_GOOGLE_PAY);
}
Works fine when user enters their payment information correctly and does not cancel, but if they do cancel, the code will be stuck indefinitely awaiting presentGooglePay to resolve.
Platform
Describe the bug If the user presses the close button in the Google Pay interface,
GooglePayEventsEnum.Canceled
is not emitted nor is any error thrown. In my experience only the eventsGooglePayEventsEnum.Loaded
andGooglePayEventsEnum.Completed
work.This bug seems to be present in the demo as well.
It should at the very least throw an unknown error: right now it appears that the Promise is never resolved or rejected
I have not tested with Apple Pay as I have not set it up yet, but this problem could be relevant to it as well.
To Reproduce Steps to reproduce the behavior:
Expected behavior I expect an event to be emitted when user deliberately closes the Google Pay interface, either via the close button or clicking outside of the modal.
If resolving the Promise with a specific event is not possible, at least throw an error so async logic can complete. Code such as
Works fine when user enters their payment information correctly and does not cancel, but if they do cancel, the code will be stuck indefinitely awaiting
presentGooglePay
to resolve.Listening to events such as
Does not work either, only Loaded / Completed seem to be emitted.
Screenshots
Additional context "@stripe-elements/stripe-elements": "2.0.2" "@capacitor-community/stripe": "^4.2.0" "react": "^18.2.0"
I use the
useCapacitorStripe
hook which works fine otherwise.