File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ Note: make sure you are using the HMAC key used to generate the signature associ
8
8
### Payments webhooks
9
9
10
10
Copy the content of the webhook in the payload.json (or provide a different file), then run with:
11
- ` node hmacValidatorPayments .js {hmacKey} {path to JSON file} `
11
+ ` node calculateHmacPayments .js {hmacKey} {path to JSON file} `
12
12
```
13
13
cd tools/hmac
14
- node hmacValidatorPayments .js 11223344D785FBAE710E7F943F307971BB61B21281C98C9129B3D4018A57B2EB tools/hmac/ payload.json
14
+ node calculateHmacPayments .js 11223344D785FBAE710E7F943F307971BB61B21281C98C9129B3D4018A57B2EB payload.json
15
15
```
16
16
Original file line number Diff line number Diff line change 1
1
// script to calculate the HMAC signature of Payments webhooks (where the signature is calculated considering
2
2
// a subset of the fields in the payload - i.e. NotificationRequestItem object)
3
3
//
4
- // Run with: `node hmacValidatorPayments .js {hmacKey} {path to JSON file}
4
+ // Run with: `node calculateHmacPayments .js {hmacKey} {path to JSON file}
5
5
//
6
6
// cd tools/hmac
7
- // node hmacValidatorPayments .js 11223344D785FBAE710E7F943F307971BB61B21281C98C9129B3D4018A57B2EB payload.json
7
+ // node calculateHmacPayments .js 11223344D785FBAE710E7F943F307971BB61B21281C98C9129B3D4018A57B2EB payload.json
8
8
9
9
const fs = require ( 'fs' ) ;
10
10
const { hmacValidator } = require ( '@adyen/api-library' ) ;
11
11
12
12
// Ensure correct arguments
13
13
if ( process . argv . length !== 4 ) {
14
- console . error ( "Usage: node HMACValidatorPayments .js <hmacKey> <payloadFile>" ) ;
14
+ console . error ( "Usage: node calculateHmacPayments .js <hmacKey> <payloadFile>" ) ;
15
15
process . exit ( 1 ) ;
16
16
}
17
17
@@ -55,5 +55,5 @@ if (!notificationRequestItem) {
55
55
const validator = new hmacValidator ( )
56
56
const hmacSignature = validator . calculateHmac ( notificationRequestItem , hmacKey ) ;
57
57
58
- console . log ( `HMAC Validation Result : ${ hmacSignature } ` ) ;
58
+ console . log ( `HMAC signature : ${ hmacSignature } ` ) ;
59
59
process . exit ( 0 ) ;
You can’t perform that action at this time.
0 commit comments