Skip to content
This repository was archived by the owner on Apr 21, 2026. It is now read-only.

Commit 248c92d

Browse files
committed
🐛 fix webhook signature
1 parent c862ee1 commit 248c92d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

includes/class-frak-webhook-helper.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public static function send( $order_id, $status, $token ) {
8484
throw new Exception( 'Failed to encode webhook payload as JSON' );
8585
}
8686

87-
$signature = hash_hmac( 'sha256', $json_body, $webhook_secret );
87+
$signature = base64_encode( hash_hmac( 'sha256', $json_body, $webhook_secret, true ) );
8888

8989
$response = wp_remote_post(
9090
$webhook_url,
@@ -256,7 +256,7 @@ public static function test_webhook() {
256256
throw new Exception( 'Webhook secret not configured' );
257257
}
258258

259-
$signature = hash_hmac( 'sha256', $json_body, $webhook_secret );
259+
$signature = base64_encode( hash_hmac( 'sha256', $json_body, $webhook_secret, true ) );
260260

261261
$response = wp_remote_post(
262262
$webhook_url,

0 commit comments

Comments
 (0)