The requests Wix sends to a Payment Service Provider's (PSP's) endpoints include a header called "Digest"
whose value is "JWT="
followed by a JSON Web Token (JWT). This token is included so that the PSP can ensure that the request comes from Wix and hasn't been tampered with.
The token is encrypted using SHA256. The token can be decrypted using the PSP's public webhook key. You can find your public key in the app dashboard. Decrypting the token results in a JSON object with the following format:
To validate requests from Wix, the PSP must:
Digest
header and removing the JWT=
prefix.Digest
header can also be called DIGEST
or digest
.exp
claim hasn't passed. This means the request is still valid."data"
claim.
Note: When calculating the message digest, use the raw bytes of the request body. Do not parse the request body before calculating the message digest. Parsing the request body or converting bytes into text may result in a different message digest, leading to validation failure.
Wix recommends using jwt.io for debugging purposes.
We created a code example using Node.js that demonstrates how to validate requests from Wix. You can use this code as a reference when you implement your own validation logic.