You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Utility to help with {@link https://developer.squareup.com/docs/webhooks/overview Square Webhooks }
6
+
*/
7
+
exportclassWebhooksHelper{
8
+
/**
9
+
* Verifies and validates an event notification.
10
+
* See the {@link https://developer.squareup.com/docs/webhooks/step3validate documentation} for more details.
11
+
*
12
+
* @param requestBody The JSON body of the request.
13
+
* @param signatureHeader The value for the `x-square-hmacsha256-signature` header.
14
+
* @param signatureKey The signature key from the {@link https://developer.squareup.com/apps Square Developer portal} for the webhook subscription.
15
+
* @param notificationUrl The notification endpoint URL as defined in the {@link https://developer.squareup.com/apps Square Developer portal} for the webhook subscription.
16
+
* @returns `true` if the signature is valid, indicating that the event can be trusted as it came from Square. `false` if the signature validation fails, indicating that the event did not come from Square, so it may be malicious and should be discarded.
0 commit comments