// GET METHOD
stringToSign = <HTTP METHOD> + ":" + <RELATIVE PATH URL> + ":" + <X-TIMESTAMP>
// POST METHOD
stringToSign = <HTTP METHOD> + ":" + <RELATIVE PATH URL> + ":" + LowerCase(HexEncode(SHA-256(Minify(<HTTP BODY>)))) + ":" + <X-TIMESTAMP>const clientSecret = "abc"
const timestamp = Date.now()
const stringToSign = "POST" + ':' + "/v1/utility/payment/channel" + ":" + timestamp
const layer1Sig = crypto.createHmac('sha256', clientSecret).update(stringToSign).digest('hex');
//Result:
//fc01508909434c5f3544f80c6937f79f8271e1db4a94682dbd5ad20e85b86868const privKey = crypto.createPrivateKey("YOUR_PRIVATE_KEY");
const layer2Sig = crypto.sign("RSA-SHA256", Buffer.from(layer1Sig), privKey)
.toString("base64")const clientSecret = "abc"
const timestamp = Date.now()
const stringToSign = "POST" + ':' + "/v1/generate/transfer/payment" + ":" + LowerCase(HexEncode(SHA-256(Minify(<HTTP BODY>)))) + ":" + timestamp + ":" + inquiryRef
// An Inquiry Ref will be provided from Transfer Inquiry API, which must be included when invoking the Transfer Payment API.
// Then the rest will be same