Skip to content

Commit f000dc5

Browse files
committed
[Non-breaking] Added async method to CustomerSheet
1 parent 648c9b7 commit f000dc5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG_v25_draft.md

+4
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,7 @@ This major version introduces many small breaking changes. Please see [MIGRATING
66
* [Changed] Replaced `IntentConfiguration.ConfirmHandler` with an async equivalent.
77
* [Added] Added async versions of all completion-block-based PaymentSheet and PaymentSheet.FlowController methods.
88

9+
### CustomerSheet
10+
* [Added] Added an async version of `present(from:)`.
11+
12+

StripePaymentSheet/StripePaymentSheet/Source/PaymentSheet/CustomerSheet/CustomerSheet.swift

+8
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ public class CustomerSheet {
125125
case error(Error)
126126
}
127127

128+
public func present(from presentingViewController: UIViewController) async -> CustomerSheetResult {
129+
await withCheckedContinuation { continuation in
130+
present(from: presentingViewController) { result in
131+
continuation.resume(returning: result)
132+
}
133+
}
134+
}
135+
128136
public func present(from presentingViewController: UIViewController,
129137
completion csCompletion: @escaping (CustomerSheetResult) -> Void
130138
) {

0 commit comments

Comments
 (0)