Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: stripe/stripe-ios
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 4e63affc45806b42f50a44ca439846ab5baf5b2b
Choose a base ref
..
head repository: stripe/stripe-ios
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f000dc5f1f691cb8937dfe8cee8d026ac11385ef
Choose a head ref
Original file line number Diff line number Diff line change
@@ -77,20 +77,15 @@ class BackendViewModel: ObservableObject {
currency: "USD",
setupFutureUsage: usage
)
) { [weak self] paymentMethod, shouldSavePaymentMethod, intentCreationCallback in
guard let self = self else { return }
Task {
do {
let clientSecret = try await self.confirmIntent(
paymentMethodID: paymentMethod.stripeId,
shouldSavePaymentMethod: shouldSavePaymentMethod,
isSubscribing: isSubscribing
)
intentCreationCallback(.success(clientSecret))
} catch {
intentCreationCallback(.failure(error))
}
) { [weak self] paymentMethod, shouldSavePaymentMethod in
guard let self = self else {
throw ExampleError()
}
return try await self.confirmIntent(
paymentMethodID: paymentMethod.stripeId,
shouldSavePaymentMethod: shouldSavePaymentMethod,
isSubscribing: isSubscribing
)
}
return intentConfig
}
Original file line number Diff line number Diff line change
@@ -309,8 +309,12 @@ class PlaygroundController: ObservableObject {
if settings.apmsEnabled == .off {
paymentMethodTypes = self.paymentMethodTypes
}
let confirmHandler: PaymentSheet.IntentConfiguration.ConfirmHandler = { [weak self] in
self?.confirmHandler($0, $1, $2)
let confirmHandler: PaymentSheet.IntentConfiguration.ConfirmHandler = { [weak self] pm, billingDetails in
try await withCheckedThrowingContinuation { continuation in
self?.confirmHandler(pm, billingDetails) { result in
continuation.resume(with: result)
}
}
}

switch settings.mode {