On This Page
Client Version Changes
The following is an expanded list of details for client version updates.
Changes to Client Version 0.7 from 0.6
The following changes have been made as of 0.7.
1.
initialize() now takes the raw JWT string
As of version 0.7, the SDK accepts the undecoded JWT string and decodes it
internally.
IMPORTANT
Do
not
pass the decoded object,
the SDK will reject it.Before (v0.6)
: integrators passed the decoded JWT object { header, payload, signature, raw } as the
first argument.
Now (v0.7):
await vsdk.initialize(captureContextJwt, { // raw JWT string, not decoded dpaTransactionOptions: { /* ... */ } });
IMPORTANT
You still need to decode the JWT
yourself once, but only to read payload.ctx[0].data.clientLibrary and
clientLibraryIntegrity so you can load the SDK <script>. Don't reuse that
decoded object as the initialize() argument.
2.
getCards() no longer throws ERROR on the guest flow
As of this version, if no
Click to Pay
account is found for the email
(guest flow), getCards() resolves with the actionCode: 'ADD_CARD' instead of
throwing an error. Handle ADD_CARD as a normal actionCode branch, not in a catch
block.Before (v0.6)
: An "unknown email" lookup rejected the promise; you had to detect the guest flow
inside a catch block.
Now (v0.7):
The promise resolves and you branch on response.actionCode:
const res = await vsdk.getCards({ consumerIdentity }); switch (res.actionCode) { case 'SUCCESS': /* show saved cards */ break; case 'PENDING_CONSUMER_IDV': /* prompt for OTP */ break; case 'ADD_CARD': /* enter guest card-entry flow */ break; }