On This Page
pilot
getCards()
getCards
encapsulates all your identity calls. Make the
getCards
with the email. For unrecognized user, you’d receive
PENDING_CONSUMER_IDV
. This would trigger an OTP generation. Make
the getCards
call again with the OTP. JavaScript Example
// Get cards sample request let consumerIdentity = { identityProvider: "SRC", identityValue: "[email protected]", identityType: "EMAIL_ADDRESS" }; let cards = await vsdk.getCards({ consumerIdentity }); let { actionCode } = cards; switch (actionCode) { case 'SUCCESS': //handle getCards response in UI console.log('Handle getCards response in the UI ', cards); break; // If cards status is "PENDING_CONSUMER_IDV", call getCards again with validationData case 'PENDING_CONSUMER_IDV': const validationDataInput = { consumerIdentity, validationData: "654321"}; // Replace with your actual validation data cards = await vsdk.getCards(validationDataInput); break; case 'ERROR': console.log('Handle error cases:'); break; default: console.log('No cards found >> ', cards.actionCode); break; }
Syntax
Your
getCards()
request must have this syntax:getCards({ required ConsumerIdentity consumerIdentity; conditional String validationData; })