Integration of Kaspi QR, FreedomPay and Telegram Stars into web services

Payment webhooks with idempotency, verification of HMAC signatures, fiscalization and automatic opening of access after payment.

TL;DR · Key Answer

Reliable integration of Kaspi QR and FreedomPay requires idempotencyKey to protect against double debiting, verify the cryptographic signature of the webhook, and instantly update the status in the database.

Checklist

  • Store idempotencyKey with a unique index so that repeated webhooks do not duplicate charges.
  • Check the amount and currency from the webhook with the original order in the database.
  • Log all incoming payment events with a timestamp.

Forum Discussions (vbcd4u.com)

Все обсуждения →

Engineering Guides (MurdaSoft)

FAQ

How to avoid double charges when receiving a webhook from a payment again?

Create a collection/table of processed webhook_events with a unique idempotencyKey or paymentId and check it before changing the balance.