Starts the payment flow for the vaulted payment method. You can get the id
from any instance of PrimerHeadlessUniversalCheckout.VaultedPaymentMethod
returned by fetchVaultedPaymentMethods.
Additionally you may pass vaultedPaymentMethodAdditionalData
, which might be required by some payment methods (e.g.
you might need to pass CVV which can be recommended to increase auth rates).
Make sure that vaultedPaymentMethodAdditionalData
is validated before being passed to this method.
Upon a successful invocation of this function, the SDK will automatically trigger the standard payment delegate methods.
1
func startPaymentFlow(vaultedPaymentMethodId: String, vaultedPaymentMethodAdditionalData: PrimerVaultedPaymentMethodAdditionalData? = nil)
Parameters
Properties
The id
of a PrimerHeadlessUniversalCheckout.VaultedPaymentMethod
previously retrieved with fetchVaultedPaymentMethods.
direct subclasses
Properties
Example
It's provided that you have started PrimerHeadlessUniversalCheckout
with a client token, and you know
the vaulted payment method id.
Without additional data
12345
var vaultManager = PrimerHeadlessUniversalCheckout.VaultManager() func payWithVaultedPaymentMethod(with id: String) { self.vaultManager.startPaymentFlow(vaultedPaymentMethodId: id)}
With additional data
123456
var vaultManager = PrimerHeadlessUniversalCheckout.VaultManager() func payWithVaultedPaymentMethod(with id: String) { let vaultedCardAdditionalData = PrimerVaultedCardAdditionalData(cvv: "123") self.vaultManager.startPaymentFlow(vaultedPaymentMethodId: id, vaultedPaymentMethodAdditionalData: vaultedCardAdditionalData)}