Scratch Card Management for WHMCS
This module allows you to sell and manage prepaid scratch cards inside WHMCS. Clients can pay invoices or
add funds using card codes, while admins control card creation, status, and reporting from the backend.
Admin Features
- Create and manage cards with serial number, 14-digit code, amount, expiry date and status (active/used/expired).
- Track card usage history and who redeemed which card.
- Quick actions to activate, mark used, expire or delete cards.
- CSV export of all, active, used or expired cards.
- Logs payments via gateway callback and credits any invoice overage to the client.
Client Features
- Pay invoices with a 14-digit scratch card code via the Scratch Card Payment gateway.
- Automatic validation of code, status and expiry before accepting payment.
- Remaining value (if card exceeds invoice total) is credited to the client account.
- Redeem cards on the Add Funds page to top up account credit.
- Available balance is shown in the client sidebar using the included hooks.
Installation
Upload the following files to your WHMCS root:
modules/addons/scratchcards/scratchcards.php
modules/gateways/scratchcard.php
modules/gateways/callback/scratchcard.php
includes/hooks/scratchcard_addfunds.php
includes/hooks/whmcs-show-credit-balance.php
docs/* (optional reference)
Then in WHMCS Admin:
- Go to System Settings → Addon Modules, activate Scratch Cards (creates
mod_scratchcards table).
- Go to System Settings → Payments → Payment Gateways, enable Scratch Card Payment.
Usage
- Admin: Addons → Scratch Cards to add/manage cards and export CSV.
- Client: choose Scratch Card Payment on invoices.
- Client: redeem codes via Add Funds to add account credit.
Notes
- Card codes must be exactly 14 digits; expired or inactive cards are blocked.
- Remaining value after paying an invoice is automatically credited to the client.
- To drop data on deactivate, uncomment the drop logic in
scratchcards_deactivate() before deactivating the addon.
Live Support
WhatsApp: +8801672348154