A single-use card token can be directly exchanged for a multi-use token (i.e. a Source ID) by calling CheckoutComSavedPaymentMethodService#exchangeSingleUseTokenIfApplicable(…)
. The single-use token should be provided via the paymentMethodProperties
map, using the CheckoutConstants.TOKEN
key. From there, we’ll leverage Checkout.com APIs to produce a Source ID & return it in the response map using the CheckoutConstants.SOURCE_ID
key.
When executing an Authorize or AuthorizeAndCapture transaction with a single-use card token, Checkout.com will automatically produce a multi-use token (i.e. a Source ID). After these transactions are successfully executed, the Source ID can be gathered from the PaymentResponse by calling paymentResponse.getPaymentMethodProperties().get(CheckoutConstants.SOURCE_ID);
.