Created
August 20, 2022 05:19
-
-
Save jpcaparas/8a341edb4f0ee27f2a59fabfb2012c44 to your computer and use it in GitHub Desktop.
Postman pre-request script to generate a signature string for spatie/laravel-webhook-client
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
// Do this: | |
// - Set a `webhook_secret` variable that what you've set on the webhook server. | |
// This generates a signature string from the header | |
var signatureString = CryptoJS.HmacSHA256(request.data, pm.environment.get('webhook_secret')).toString(); | |
// This dynamically generates the {{signature}} variable. Create a Signature header with {{signature}} as the value. | |
pm.environment.set('signature', signatureString); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment