Signing the URL
The Pay Widget is configured by URL query parameters.
As the first step, you need to provide 2 params in the URL that will identify your merchant in our system:
source - the "source param" value from the merchant dashboard
signature - the JWT token generated using the "URL signature secret" from the merchant dashboard
Generating the signature
You must provide a unique signature parameter, which is a JWT token (HS256 encryption algorithm) generated using the "URL signature secret" value as a secret. You must add some unique value to the token payload to make each token unique because we don't allow creating more than 1 order using the same signature. During testing, you can generate a JWT signature using this website: https://jwt.io/. You can also provide URL configuration parameters in the JWT token payload.
An example of signature generation
import * as jsonwebtoken from 'jsonwebtoken';
import { v4 as uuid } from 'uuid';
const signature = jsonwebtoken.sign(
{
uid: uuid(),
},
YOUR_SIGNATURE_SECRET,
{
algorithm: 'HS256',
},
);After you have the source and the signature params, you can proceed to configure the widget with URL params
Last updated