Truegate SDK

Please visit https://www.npmjs.com/package/@truegate/sdk-core

Additional customer fields

The single payment start and subscription start responses can include an optional requiredFields array. Each item has a name and a type (string or number). Forward this array from your backend to your frontend along with transactionId.

For card checkout, collect the requested customer information in your own form before calling submit. The SDK does not create inputs or validate values for these additional fields. For example, Razorpay requires phone and zipcode, both with type string.

Pass the values in userDetails to the submit function returned by sdk.initCardPayment(...):

await submit({
  cardHolderName: 'John Doe',
  userDetails: {
    phone: '9000000001',
    zipcode: '560069',
  },
});

The SDK's userDetails map uses string values. When requiredFields is absent or empty, no additional fields are requested by the start response.