Created
January 26, 2024 04:02
-
-
Save cyberdev/ac84ce3dccbcd84e8ba91842b63f33c6 to your computer and use it in GitHub Desktop.
Add variable to postman header
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const this_data = JSON.parse(pm.request.body.raw) | |
const ref_id = this_data.ref_id | |
const merchant_id = pm.variables.get('merchant_id'); | |
const secret = pm.variables.get('secret'); | |
const sign_str = `${secret}-${merchant_id}-${ref_id}`; | |
const signature = CryptoJS.MD5(sign_str).toString(); | |
pm.request.headers.add({ | |
key: "HTTP-X-APPAPI-AUTHORIZATION", | |
value: signature | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment