parent
bfba079c63
commit
1f3c0a1fac
|
@ -11,7 +11,7 @@
|
|||
// This exposes internal functionality which may cause unexpected behavior if used directly.
|
||||
import Contacts
|
||||
import PassKit
|
||||
@_spi(STP) @_spi(ExperimentalPaymentSheetDecouplingAPI) @_spi(PaymentSheetSkipConfirmation) import StripePaymentSheet
|
||||
@_spi(STP) @_spi(ExperimentalPaymentSheetDecouplingAPI) import StripePaymentSheet
|
||||
import SwiftUI
|
||||
import UIKit
|
||||
|
||||
|
@ -705,7 +705,7 @@ extension PaymentSheetTestPlayground {
|
|||
switch integrationType {
|
||||
case .deferred_mp:
|
||||
// multiprocessor
|
||||
intentCreationCallback(.success(PaymentSheet.IntentConfiguration.COMPLETE_WITHOUT_CONFIRMING_INTENT))
|
||||
intentCreationCallback(.success(PaymentSheet.IntentConfiguration.FORCE_SUCCESS))
|
||||
return
|
||||
case .deferred_csc:
|
||||
if integrationType == .deferred_csc {
|
||||
|
|
|
@ -40,7 +40,7 @@ extension PaymentSheet {
|
|||
let clientSecret = try await fetchIntentClientSecretFromMerchant(intentConfig: intentConfig,
|
||||
paymentMethod: paymentMethod,
|
||||
shouldSavePaymentMethod: confirmType.shouldSave)
|
||||
guard clientSecret != IntentConfiguration.COMPLETE_WITHOUT_CONFIRMING_INTENT else {
|
||||
guard clientSecret != IntentConfiguration.FORCE_SUCCESS else {
|
||||
// Force close PaymentSheet and early exit
|
||||
completion(.completed)
|
||||
STPAnalyticsClient.sharedClient.logPaymentSheetEvent(event: .paymentSheetForceSuccess)
|
||||
|
|
|
@ -15,9 +15,9 @@ import Foundation
|
|||
/// - Seealso: https://stripe.com/docs/payments/finalize-payments-on-the-server
|
||||
struct IntentConfiguration {
|
||||
|
||||
/// Pass this into `intentCreationCallback` to force PaymentSheet to show success, dismiss the sheet without confirming payment, and return a PaymentSheetResult of `completed`.
|
||||
/// - Note: ⚠️ Only for advanced users, not required for most integrations.
|
||||
@_spi(PaymentSheetSkipConfirmation) public static let COMPLETE_WITHOUT_CONFIRMING_INTENT = "COMPLETE_WITHOUT_CONFIRMING_INTENT"
|
||||
/// Pass this into `intentCreationCallback` to force PaymentSheet to show success and dismiss.
|
||||
/// - Note: Only for advanced users, not required for most integrations.
|
||||
@_spi(STP) public static let FORCE_SUCCESS = "FORCE_SUCCESS"
|
||||
|
||||
/// Called when the customer confirms payment.
|
||||
/// Your implementation should follow the [guide](https://stripe.com/docs/payments/finalize-payments-on-the-server) to create (and optionally confirm) PaymentIntent or SetupIntent on your server and call the `intentCreationCallback` with its client secret or an error if one occurred.
|
||||
|
|
|
@ -61,7 +61,7 @@ extension STPApplePayContext {
|
|||
intentConfig.confirmHandler(stpPaymentMethod, shouldSavePaymentMethod) { result in
|
||||
switch result {
|
||||
case .success(let clientSecret):
|
||||
guard clientSecret != PaymentSheet.IntentConfiguration.COMPLETE_WITHOUT_CONFIRMING_INTENT else {
|
||||
guard clientSecret != PaymentSheet.IntentConfiguration.FORCE_SUCCESS else {
|
||||
completion(STPApplePayContext.FORCE_SUCCESS, nil)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue