Skip to content

Commit

Permalink
Support saving customer for Dashboard (#1413)
Browse files Browse the repository at this point in the history
Updates the Dashboard flow for PaymentSheet to allow 
for saving the payment method to a customer.
  • Loading branch information
mludowise-stripe authored Sep 8, 2022
1 parent bd64f03 commit 455b881
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Stripe/Intent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,12 @@ class IntentConfirmParams {

// Dashboard only supports a specific payment flow today
assert(paymentMethodOptions == nil)
assert(shouldSavePaymentMethod == false)
params.paymentMethodOptions = STPConfirmPaymentMethodOptions()
let options = STPConfirmPaymentMethodOptions()
options.setSetupFutureUsageIfNecessary(shouldSavePaymentMethod, paymentMethodType: paymentMethodType)
let cardOptions = STPConfirmCardOptions()
cardOptions.additionalAPIParameters["moto"] = true
params.paymentMethodOptions?.cardOptions = cardOptions
options.cardOptions = cardOptions
params.paymentMethodOptions = options
return params
}
}
Expand Down

0 comments on commit 455b881

Please sign in to comment.