Add a card to a digital wallet
Last updated: July 5, 2023
If you've integrated the Issuing Android SDK or iOS SDK into your app, you can make use of its functionality to allow your cardholders to add a card to their digital wallet
Push provisioning requires a complex interaction between multiple entities including you, Checkout.com, the card scheme, and Google or Apple. As such, for a successful provisioning operation, you must have completed onboarding, and be using the CheckoutCardManagement
library provided by the SDK.
Note
If you attempt a provisioning operation without proper onboarding, your app will crash.
If you're using the iOS SDK's CheckoutCardManagementStub
library, the push provisioning operation will behave as expected, but no interaction between Checkout.com, Apple Wallet, and the card scheme will occur. The result depends on which Checkout.com environment you're using with the SDK's stub environment:
- with Checkout.com's production environment, you'll receive an
OperationResult
success message - with Checkout.com's sandbox environment, you'll receive a
pushProvisioningFailure
error, as push provisioning is only valid in production
You must authenticate your cardholders for each session in which they use functionality provided by the SDK.
In the sandbox and production SDK environments, you are responsible for authenticating users. To do this, use an access token that your application has received from your authentication back end.
Note
In the iOS SDK's stub environment, you can provide any String
instead, as all responses return mock data. The Android SDK does not provide a stub environment.
1val token = "<ACCESS_TOKEN>"2cardManager.logInSession("<ACCESS_TOKEN>")
Once you’ve authenticated the cardholder, you can return a list of their cards:
1cardManager.getCards { result: Result<List<Card>> ->2result.onSuccess {3// You'll receive a list of cards that you can integrate within your UI4// The card info includes the last 4 digits (PAN), expiry date, cardholder name, card state, and id5}.onFailure {6// If something goes wrong, you'll receive an error with more details7}8}
When you have the card that you want to add to a digital wallet, you can make a call to provision it:
1card.provision(2activity = theActivityHandleTheProvisionOutcome,3cardholderID = "{id_of_cardholder_performing_operation}",4configuration = ProvisioningConfiguration(/* */),5token = "{specific_token_generated_for_operation}",6completionHandler = { result: Result<Unit> ->7// Callback after the operation has completed8}9)