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

[v25] Adds async APIs to PaymentSheet, FlowController, CustomerSheet #4615

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yuki-stripe
Copy link
Collaborator

@yuki-stripe yuki-stripe requested review from a team as code owners March 1, 2025 23:42
Copy link

github-actions bot commented Mar 1, 2025

⚠️ Public API changes detected:

StripePaymentSheet

+ #if compiler(>=5.3) && $AsyncAwait
- public func present(from presentingViewController: UIKit.UIViewController) async -> StripePaymentSheet.CustomerSheet.CustomerSheetResult
+ #endif
- public var cardBrandAcceptance: StripePaymentSheet.PaymentSheet.CardBrandAcceptance
+ #if compiler(>=5.3) && $AsyncAwait
- public func present(from presentingViewController: UIKit.UIViewController) async -> StripePaymentSheet.PaymentSheetResult
+ #endif
- public var cardBrandAcceptance: StripePaymentSheet.PaymentSheet.CardBrandAcceptance
+ #if compiler(>=5.3) && $AsyncAwait
+ #endif
- public typealias ExternalPaymentMethodConfirmHandler = (_ externalPaymentMethodType: Swift.String, _ billingDetails: StripePayments.STPPaymentMethodBillingDetails, _ completion: @escaping ((StripePaymentSheet.PaymentSheetResult) -> Swift.Void)) -> Swift.Void
+ #if compiler(>=5.3) && $AsyncAwait
- public typealias ExternalPaymentMethodConfirmHandler = (_ externalPaymentMethodType: Swift.String, _ billingDetails: StripePayments.STPPaymentMethodBillingDetails) async -> StripePaymentSheet.PaymentSheetResult
+ #endif
- }
- public enum CardBrandAcceptance : Swift.Equatable {
- public enum BrandCategory : Swift.Equatable {
- case visa
- case mastercard
- case amex
- case discover
- public func hash(into hasher: inout Swift.Hasher)
- public static func == (a: StripePaymentSheet.PaymentSheet.CardBrandAcceptance.BrandCategory, b: StripePaymentSheet.PaymentSheet.CardBrandAcceptance.BrandCategory) -> Swift.Bool
- public var hashValue: Swift.Int {
- get
- }
- }
- case all
- case allowed(brands: [StripePaymentSheet.PaymentSheet.CardBrandAcceptance.BrandCategory])
- case disallowed(brands: [StripePaymentSheet.PaymentSheet.CardBrandAcceptance.BrandCategory])
- public static func == (a: StripePaymentSheet.PaymentSheet.CardBrandAcceptance, b: StripePaymentSheet.PaymentSheet.CardBrandAcceptance) -> Swift.Bool
- public typealias ConfirmHandler = (_ paymentMethod: StripePayments.STPPaymentMethod, _ shouldSavePaymentMethod: Swift.Bool, _ intentCreationCallback: @escaping ((Swift.Result<Swift.String, any Swift.Error>) -> Swift.Void)) -> Swift.Void
+ #if compiler(>=5.3) && $AsyncAwait
- public typealias ConfirmHandler = (_ paymentMethod: StripePayments.STPPaymentMethod, _ shouldSavePaymentMethod: Swift.Bool) async throws -> Swift.String
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
- public static func create(paymentIntentClientSecret: Swift.String, configuration: StripePaymentSheet.PaymentSheet.Configuration) async throws -> StripePaymentSheet.PaymentSheet.FlowController
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
- public static func create(setupIntentClientSecret: Swift.String, configuration: StripePaymentSheet.PaymentSheet.Configuration) async throws -> StripePaymentSheet.PaymentSheet.FlowController
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
- public static func create(intentConfiguration: StripePaymentSheet.PaymentSheet.IntentConfiguration, configuration: StripePaymentSheet.PaymentSheet.Configuration) async throws -> StripePaymentSheet.PaymentSheet.FlowController
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
- public func presentPaymentOptions(from presentingViewController: UIKit.UIViewController) async
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
- public func confirm(from presentingViewController: UIKit.UIViewController) async -> StripePaymentSheet.PaymentSheetResult
+ #endif
+ #if compiler(>=5.3) && $AsyncAwait
- public func update(intentConfiguration: StripePaymentSheet.PaymentSheet.IntentConfiguration) async throws
+ #endif

If you are adding a new public API consider the following:

  • Do these APIs need to be public or can they be protected with @_spi(STP)?
  • If these APIs need to be public, assess whether they require an API review.

If you are modifying or removing a public API:

  • Does this require a breaking version change?
  • Do these changes require API review?

If you confirm these APIs need to be added/updated and have undergone necessary review, add the label modifies public API to this PR to acknowledge and bypass this check.

ℹ️ If this comment appears to be left in error, make sure your branch is up-to-date with master.

@yuki-stripe yuki-stripe force-pushed the yuki/v25-paymentsheet-async branch from e931361 to 4e63aff Compare March 3, 2025 17:43
@yuki-stripe yuki-stripe force-pushed the yuki/v25-paymentsheet-async branch from 4e63aff to f000dc5 Compare March 3, 2025 17:45
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

Successfully merging this pull request may close these issues.

1 participant