Enable the saving of payment instruments so that you can offer features such as recurring payments, one-click checkout, and delayed payment.

Save a payment instrument

Let your customers save payment instruments by using the vault manager:

// determine what to do when the payment instruments was saved.
private val listener = object : CheckoutEventListener (
    onTokenizeSuccess = { data ->
			// ...
    },
)

Primer.instance.configure(config, listener)

Primer.instance.showVaultManager(context, token)

Fetch all saved payment instruments

You can list all the saved payment instruments saved by a given customer at any time with the SDK's fetchSavedPaymentMethods method.

// determine what to do when payment instruments have been fetched.
private val listener = object : CheckoutEventListener (
    onSavedPaymentInstrumentsFetched = { data ->
			// ...
    },
)

Primer.instance.configure(config, listener)

Primer.instance.fetchSavedPaymentInstruments(token)