Skip to content

[BUG] STPPaymentIntentCaptureMethod missing enum case #4329

Open
@sschizas

Description

Summary

The STPPaymentIntentCaptureMethod doesn't support payment intents with capture_method = automatic_async .

Code to reproduce

The PaymentSheet.IntentConfiguration.CaptureMethod supports manual, automatic, and automatic_async (the default value in the Payment Intent creation API). In contrast, STPPaymentIntentCaptureMethod supports manual, automatic, and unknown—used when the SDK does not recognize the Payment Intent's capture method value.

In the PaymentSheetDeferredValidator, a check ensures that the received Payment Intent's capture method matches the one configured in the PaymentSheet. Consequently, when a Payment Intent is created with the default capture_method value, the PaymentSheet fails to validate and confirm it.

This behavior was verified by creating two Payment Intents using a cURL command: one with the automatic capture method and another with automatic_async. The former was successfully verified, while the latter failed, triggering the error: "Your PaymentIntent capture method (unknown) does not match the PaymentSheet.IntentConfiguration amount (automaticAsync)."

I used the ExampleCustomDeferredCheckoutViewController example as a guide to implement it in my project.

iOS version

Tested on iPhone 16 Simulator (iOS 18.1)

Installation method

Via Swift package manager

SDK version

24.1.1

Other information

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    fixed in masterFixed in master, awaiting next updatekind:bugtriagedIssue has been reviewed by Stripe and is being tracked internally

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions