Blog Archive

Duplicate VTU Webhooks: Prevent Double Credits and Repeat Purchases

  • BY:None

Two webhook notifications do not necessarily mean two purchases. A reseller's application must distinguish an incoming notification from the transaction it describes before changing a wallet balance or triggering fulfilment.

This problem differs from deciding whether to retry an outgoing purchase after a timeout. Here, the provider is notifying your system about an order that already exists.

Use the actual provider's rules

Read its documented authentication method, event identifiers, transaction references, retry behaviour and status meanings. Do not copy a signature header or sample payload from another supplier and assume it applies.

OWASP's webhook guidance covers authentication and duplicate-event handling. Vtunaija's own documentation, for example, describes event IDs and warns that the receiving application must implement duplicate protection. That is an illustration of provider-specific documentation, not a claim about YHOMMYDATA's interface.

Ask the developer to separate three records

The customer order records what was bought.

The provider transaction records what the supplier processed.

The event record tracks a notification received about that transaction.

A repeated notification should not silently create a second customer purchase. Similarly, a second event with a different identifier should not automatically justify another wallet credit for the same business outcome.

Walk through a hypothetical duplicate

Imagine order SHOP-104 already has a confirmed successful provider transaction. The receiver processes a success event, but the sender does not receive the acknowledgement. The same event arrives again.

The expected outcome is still one completed order. The application should recognise what it already processed and acknowledge according to the provider's rules. It should not buy another bundle or add the sale amount again.

Protect the update itself

Ask the developer how duplicate protection works if two copies arrive at the same time or the process stops midway. A visible “already received” flag is insufficient if it can be stored separately from the financial change and leave inconsistent records. Use an appropriate atomic database operation and a documented recovery process.

Request tests for a repeated event, simultaneous copies, an invalid signature and a later status that conflicts with the current transaction. Use supported test tools, not manufactured live customer credits.

Keep unresolved events visible

Store the reason a notification could not be matched and investigate it against the provider's confirmed record. Do not treat every callback as a fresh instruction to vend.

For YHOMMYDATA orders, keep the original reference and investigate through https://yhommydata.com/ before placing replacements. Confirm current integration capabilities with authorised support before implementing callbacks. Related guidance: https://yhommydata.com/blog/vtu-api-timeout-before-retrying-data-order/

References: https://cheatsheetseries.owasp.org/cheatsheets/Webhook_Security_Cheat_Sheet.html and https://vtunaija.com.ng/documentationApiIntegration/webhook-doc.php

You may also like