/
Initialize Token Fields

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. This script will be used to load the NetValve SDK.

It must have the following attributes:

Attribute

Value

Attribute

Value

src

{{netvalveScriptSrc}}

integrity

{{integrity}}

crossorigin

"anonymous"

type

"text/javascript"

Example

<script type="text/javascript" integrity={{integrity}} crossorigin="anonymous" src={{netvalveScriptSrc}}> </script>

Note ** {{ }} implies a property from the api response.

Next Step: integrate SDK

SDK Integration Approaches

Related content

SDK Integration Approaches
SDK Integration Approaches
More like this
Token Fields (HPF)
Token Fields (HPF)
More like this
Form Submission
Form Submission
More like this
Styling
Read with this
Call Sale API with token
Call Sale API with token
More like this
Step 1: 3DS Initialisation Api
Step 1: 3DS Initialisation Api
More like this