On This Page
pilot
checkout()
This method performs checkout using the specified digital card or PAN. If successful, the
response contains summary checkout information and, conditionally, an encrypted payload
signed by the SRC System containing PCI and/or PII data.
This method is called after the consumer has chosen a card for checkout from the card
list or when the consumer enrolls a new card.
To add a card, the partner or merchant must provide the encrypted card object, instead of
ID of the digital card identifier, as an input parameter. The card will be enrolled into
the SRC system and used for checkout.
The
checkout()
method uses three types of keys:- JWT validation keys: The checkout response fromvsdk.checkout()is a signed JWT with the payment credentials. The response must be verified server-side by retrieving the RSA public key fromusing thehttps://api.cybersource.com/flex/v2/public-keyskidfrom the header of each JWT.Cybersourcerecommends that you do not skip this step, as this verification exposes the integration to payload tampering. For information about JWT validation keys, see JWT Validation Keys.
- Client-side PAN encryption keys: When you add a card toUnified Click to Pay, the customer manually enters their card details in the UI. The raw PAN must be JWE-encrypted in the browser before it is passed tocheckout(encryptedCard). The encryption key is a per-network RSA JWK from the/sessionsAPI response frompaymentConfigurations.[SRCVISA|SRCMASTERCARD|SRCAMEX].panEncryptionKey. The encyrypted key is selected using the PAN's BIN range. For information about client-side PAN encryption keys, see Client-Side PAN Encryption Keys.
- Token Management MLE keys: Thecheckout()response can include PCI/PII data that is in theencryptedPayloadfield. This data is encrypted byCybersourceusing the merchant's RSA public key uploaded to theCybersourceBusiness Center. The merchant decrypts it server-side using their corresponding private key. For information about Token Management MLE keys, see Token Management MLE Keys.
JavaScript Example
//sample checkoutParameters const checkoutParameters = { srcDigitalCardId: 'nE5xhI3jQcSis6Vf7IAH-A000000000000US', dpaTransactionOptions: { dpaBillingPreference: 'POSTAL_COUNTRY', dpaAcceptedBillingCountries: ['US', 'CA'], consumerNationalIdentifierRequested: false, merchantCategoryCode: '4829', merchantCountryCode: 'US', merchantOrderId: '8e15ce5c-58a3-4748-acab-71c67432dfa7', paymentOptions: [ { dpaDynamicDataTtlMinutes: 2, dynamicDataType: 'CARD_APPLICATION_CRYPTOGRAM_LONG_FORM' } ] }, payloadTypeIndicatorCheckout: 'FULL' }; // Call checkout const checkoutResponse = await vsdk.checkout(checkoutParameters); // Log the checkout response console.log(checkoutResponse);
Syntax
Your
checkout()
request must have this syntax:checkout({ conditional String srcDigitalCardId; conditional JWE<Card> encryptedCard; optional Consumer consumer; optional DpaTransactionOptions dpaTransactionOptions; optional PayloadTypeIndicator payloadTypeIndicatorCheckout; conditional Window windowRef; conditional ComplianceSettings complianceSettings; optional AssuranceData assuranceData; })