> For the complete documentation index, see [llms.txt](https://docs.paymento.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.paymento.io/payment-links/webhooks-for-payment-links/troubleshooting.md).

# Troubleshooting

Common issues and solutions

#### Common Issues

**1. Signature Verification Fails**

**Problem:** The computed signature doesn't match `X-Paymento-Signature`.

**Solutions:**

* ✅ Sign `{eventId}:{eventType}:{timestamp}` — **not** the request body
* ✅ Take the three values from the `X-Paymento-Event-Id`, `X-Paymento-Event-Type` and `X-Paymento-Timestamp` headers, unmodified
* ✅ Use your store's **Secret Key** as plain UTF-8 text (no hex or base64 decoding), with no surrounding whitespace
* ✅ Compute **HMAC-SHA256** (not plain SHA-256)
* ✅ Compare **case-insensitively** — Paymento sends **uppercase** hex, most libraries produce lowercase

{% code expandable="true" %}

```javascript
// ❌ Wrong - signing the body
const signature = crypto
  .createHmac('sha256', secretKey)
  .update(req.rawBody)
  .digest('hex');

// ✅ Correct - signing the three event headers
const message = `${req.get('X-Paymento-Event-Id')}:${req.get('X-Paymento-Event-Type')}:${req.get('X-Paymento-Timestamp')}`;
const signature = crypto
  .createHmac('sha256', secretKey)
  .update(message)
  .digest('hex')
  .toUpperCase();
```

{% endcode %}

**2. `req.body.event` Is Undefined**

Body property names are PascalCase: use `req.body.Event.Type`, `req.body.PaymentLink.Id`, `req.body.Customer.Email`, and so on.

**3. Webhooks Not Being Received**

**Checklist:**

* ✅ Is your endpoint publicly accessible?
* ✅ Is it using HTTPS?
* ✅ Is there a firewall blocking Paymento's servers?
* ✅ Is the webhook URL correctly configured in the payment link?
* ✅ Is it a Telegram-integrated payment link? Those deliver events to Paymento's Telegram bot, not to your URL.

**4. Receiving the Same Event Twice**\
**Solution:** Implement idempotency using `Event.Id` ([see Best Practices #5](https://docs.paymento.io/payment-links/webhooks-for-payment-links/best-practices.md)).

**5. Timeout Errors**

**Problem:** Your endpoint takes too long to respond.\
**Solution:** Move heavy processing to background jobs and respond immediately. A timed-out delivery is **not retried**.
