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

[BUG] Not possible to distinguish between dismiss and continue on the PaymentSheet.FlowController #3965

Open
jonashinge opened this issue Aug 27, 2024 · 3 comments
Labels
kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally

Comments

@jonashinge
Copy link

jonashinge commented Aug 27, 2024

Summary

When calling presentPaymentOptions(from:, completion:) on the PaymentSheet.FlowController it seems to be impossible to detect whether the user actually pressed the CTA "Continue" button or the dismiss button. The paymentOption seems to filled out with the payment data also in the case of an explicit dismissal (where all e.g. credit card data has been filled out). Looks like there's an internal didPresentAndContinue Bool on the FlowController. Maybe you could make this public? Or at least keep the paymentOption nil always on an explicit dismissal?

Code to reproduce

  1. Present the PaymentSheet.FlowController
  2. Fill out the e.g. card information (has to be valid and completely filled out)
  3. Dismiss the sheet by pressing the dismiss button
  4. Note that in the completion block the paymentOption is filled out with the data and there is no way to detect whether it was a dismissal

iOS version

17.2

Installation method

Cocoapods

SDK version

23.29.1

@jonashinge
Copy link
Author

Another suggestion could be to simply provide the didCancel flag in the presentPaymentOptionsCompletion closure.

Screenshot 2024-08-28 at 23 22 26

@davidme-stripe davidme-stripe added the triaged Issue has been reviewed by Stripe and is being tracked internally label Sep 17, 2024
@davidme-stripe
Copy link
Contributor

Hi, thanks for filing this! The behavior of the cancel button is intentional: The FlowController sheet is is intended to modify the FlowController's payment information, so we don't discard any information provided by the user when they dismiss the sheet. We won't complete the payment until you call confirm() on the FlowController.

That said, we can look into providing an API to enable this! Can you share more about how you're using FlowController? Are you trying to confirm automatically after the sheet is dismissed?

@jonashinge
Copy link
Author

Thanks for the reply!

Yes, I was trying to confirm automatically right after dismissal. I know this might be a workaround and not the intentional use of the FlowController but that was the only way I could control and make sure the sheet was dismissed and I could return to our own flow.
Long story short I ended up using the PaymentSheet instead but with another workaround in case of failed/cancelled 3ds (that's another story).

Sticking to the topic/issue here, I guess it makes sense not to discard the information but I think it would still make sense to be able to distinguish between a dismissal of the sheet or a "save/done" action. In case the user opens the FlowController sheet the first time, put's in some credit card information but dismisses the sheet, it wouldn't be expected that the payment information is saved (shown our own flow) no?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug triaged Issue has been reviewed by Stripe and is being tracked internally
Projects
None yet
Development

No branches or pull requests

2 participants