Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Payment sheet opens multiple times if it was closed before by the user #1635

Open
hbel opened this issue Apr 3, 2024 · 0 comments
Open

Payment sheet opens multiple times if it was closed before by the user #1635

hbel opened this issue Apr 3, 2024 · 0 comments

Comments

@hbel
Copy link

hbel commented Apr 3, 2024

Describe the bug

The Paymentsheet offers a close button that closes the presented sheet with an error: The payment option selection flow has been cancelled.

When I try to open the sheet again, it opens up twice. I can close the second sheet, but the first sheet is not respondng at all and is blocking the UI.

This is independent whether I call initPaymentSheet again before opening up the sheet for the second time or not.

Please note that other Error (like Country code is invalid) don't lead to this error. Also the happy path is working as expected.

To Reproduce
Steps to reproduce the behavior:
This is the basic flow I am performing inside my payment screen:

initPaymentSheet({
				...sheetData,
				customFlow: true,
				merchantDisplayName: "Example Inc.",
				returnURL: "famfam://return-url",

				defaultBillingDetails: {
					name: inviteState.fullName,
					address: {
						city: inviteState.city,
						country: inviteState.countryCode,
						line1: inviteState.address,
						postalCode: inviteState.zipCode,
					},
				},
				billingDetailsCollectionConfiguration: {
					name: PaymentSheet.CollectionMode.NEVER,
					email: PaymentSheet.CollectionMode.NEVER,
					address: PaymentSheet.AddressCollectionMode.NEVER,
					attachDefaultsToPaymentMethod: true,
				},
			})
				.then(({ error }) => {
					if (error) {
						throw error;
					}
				})
				.then(() => presentPaymentSheet())
				.then(({ error }) => {
					if (error) {
						throw error;
					}
				})
				.then(confirmPaymentSheetPayment)
				.then(({ error }) => {
					if (error) {
						throw error;
					}
				})
				.then(next)
				.catch(e => {
					setError(e.message ?? "Unknown error");
					reset();
				});
		}

Expected behavior
After presentPaymentSheet ran into an error, the whole payment sheet internals should be resetted to a blank slate.

Smartphone (please complete the following information):

  • Device: any IPhone
  • OS: iOS 17.4
  • Version: 0.35.1 with Expo SDK 50

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant