Skip to content
View in the app

A better way to browse. Learn more.

Loyverse Town

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Issue with Webhook Signature Verification when Request Body Contains Arabic Characters

Featured Replies

 

Hello,
I’m implementing webhook signature verification for Loyverse in PHP. The verification works correctly when the request body contains only English characters.

However, when the payload includes Arabic characters, the generated signature does not match the X-Loyverse-Signature header, and the verification fails.

Here’s the relevant code snippet:

```php

protected function verifySignature($headers) {
    $input = file_get_contents('php://input');
    if (empty($headers['X-Loyverse-Signature'])) {
        return false;
    }

    $signatureHeader = $headers['X-Loyverse-Signature'];
    $secret = 'MY_WEBHOOK_SECRET';

    $calculatedSignature = hash_hmac('sha1', $input, $secret, false);

    return hash_equals($signatureHeader, $calculatedSignature);
}
 

```

✅ Works fine with English payloads.
❌ Fails when the payload contains Arabic (e.g., product names, notes, etc.).

Is there a solution?

Thanks in advance!

Edited by MohamedH

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.