Fix issue with CaptureMethod.Manual on iOS. #2002
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request fixes a bug in the stripe_ios package where the intent configuration capture method is ignored, when using deferred payments.
Steps to reproduce the bug
Add
captureMethod: CaptureMethod.Manual
to theIntentMode
in the deferred payments example from https://docs.page/flutter-stripe/flutter_stripe/sheet_deferredUpdate the backend to create a payment intent with the capture method set to manual.
Run the example on iOS.
Expected result:
The payment intent is confirmed when the user taps the pay button in the payment sheet.
Actual result:
The following error is printed in the payment sheet:
"An error occurred in PaymentSheet. Your PaymentIntent captureMethod (manual) does not match the PaymentIntent.IntentConfiguration amount (automatic)"
The captureMethod parameter is ignored by the stripe_ios package and the automatic capture method is always used regardless of the value given for captureMethod.