On This Page
pilot
Loading the JavaScript Library
Use the
clientLibrary
asset path and
clientLibraryIntegrity
value that is returned by the capture
context response to invoke Unified Click to Pay
.You must retrieve these values from the :
clientLibrary
and
clientLibraryIntegrity
fields that are returned in the JWT from
https://apitest.cybersource.com
/uctp/v1/sessions"data": { "clientLibrary": "[EXTRACT clientLibrary VALUE from here]", "clientLibraryIntegrity": "[EXTRACT clientLibraryIntegrity VALUE from here]" }
You can use these values to create your script
tags:
<script src="[INSERT clientLibrary VALUE HERE]" integrity=”[INSERT clientLibraryIntegrity VALUE HERE]” crossorigin=”anonymous”></script> <script> var vsdk = window.VSDK </script>
You must perform this process for each transaction, as these values are unique for each
transaction. You must avoid hard-coding values for the
clientLibrary
and clientLibraryIntegrity
fields to prevent client-side errors.IMPORTANT
Use the
clientLibrary
and
clientLibraryIntegrity
parameter values in the capture context
response to obtain the Unified Click to Pay
JavaScript library URL and the
integrity value. This ensures that you are always using the most up-to-date library and
protects against fraud. Do not hard-code the Unified Click to Pay
JavaScript
library URL or integrity value.When you load the library, the capture context from your initial server-side request is
used to invoke the accept function.