Initialize Token Fields
The first step is to use the NetValve Payment API to generate the SDK url, which can be used to create a <script>
element on the payment page.
This is a serverside/backend operation.
API details
Mode:- Stateless REST API
API URL: - {{paymentApiUrl}}/hpf/initializeSession
HTTP Method:- GET
Authentication: uses netvalve client ID, apiKey and basic auth. See here.
{{paymentApiUrl}}/hpf/initializeSession
GET
response
{
"traceID": "120d2e14-e768-4b28-a4ae-32740c27d2f2",
"responseTimestamp": "2024-12-20T08:37:25.059+00:00",
"responseCode": "GTW_1003",
"responseMessage": "Hosted Payment Fields Token Created Successful.",
"netvalveScriptSrc": "https://tokenfieldsdk.dev.sandbox-netvalve.com/index.D-XdwYDH.js?version=D-XdwYDH&paymentToken=735be51c-350a-4d91-af8a-f26300804a9b&jwtToken=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJqdGkiOiJmMzhkYzE5MC02ZDQ2LTRiYTAtYTlhYi00ODI0NmE4MjViYjIiLCJpYXQiOjE3MzQ2ODM4NDUsImlzcyI6Ik5FVFZBTFZFIiwiZXhwIjoxNzM0Njg0MTQ1fQ.bEwrZ0rpPK_3ZEitx24-CBSgmOqAX1ZhOGYCualNRGg",
"version": "D-XdwYDH",
"integrity": "a9d74bfb-12d6-422c-a230-fdcc351afc52",
"paymentToken": "735be51c-350a-4d91-af8a-f26300804a9b"
}
After a successful response:
Use the netvalveScriptSrc
to construct a <script>
html element on your payment page:
<script type="text/javascript" src={{netvalveScriptSrc}}></script>
This script will be used to load the NetValve SDK.
** note: currently in development is the integrity
property. Once released, this will need to be added as an attribute to the script tag.
Next Step: add the netvalve payment fields