Vulca Posted Thursday at 05:10 PM Share Posted Thursday at 05:10 PM Hi everyone, I run a hosting service that provides game servers (like ARK, Minecraft, etc.), and I'm looking to implement a system where a user can receive public donations from their community, which would be automatically credited to their WHMCS account balance. Here’s the idea: A client purchases a server from our platform. They receive a unique donation URL or form that they can share with their community (e.g., players of their ARK server). When someone uses this link, they can make a payment/donation (ideally without needing to register), and the funds are automatically added to the original client’s credit balance in WHMCS, which they can then use to pay their invoices. I'm aware of the AddCredit API function and that it's possible to implement this with custom development. But before diving in, I wanted to ask: Has anyone already built or implemented something like this? Does a module already exist that achieves this? Is there a best-practice or advice from someone who’s done something similar? The goal is to allow communities to easily fund the hosting of game servers without forcing every donor to register on WHMCS. Thanks a lot for any insight or pointers! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted Friday at 01:14 PM Share Posted Friday at 01:14 PM (edited) Your idea is technically doable in WHMCS, but there are some important fiscal and accounting issues to be aware of. The main challenge is that the money would come from someone who is not your client, while the credit is assigned to a third party (your actual client). This creates a mismatch between the payment and the service, meaning you would legally need to issue a receipt or invoice to the donor even though the benefit goes to someone else. On top of that, VAT and taxes can get tricky. If the donation is treated as payment for a service, VAT normally applies, but calling it a "pure donation" isn't straightforward, since the money is effectively being used to pay for another person's services. And when your client eventually uses the credit to pay for their server, that counts as a separate transaction requiring its own invoice, which could create accounting confusion or even potential tax issues (double taxation) if not handled carefully. So, while WHMCS can handle the technical side, the real challenge is making sure this setup is compliant from a fiscal perspective. That being said, personally I would avoid playing with real money. Instead I'd create an alternative currency (credits, tokens or coins) that donors purchase and for which you issue an invoice. The beneficiary who receives the donation can then use those tokens at payment time to reduce the total of an invoice, for example by redeeming a discount coupon that adds a negative line on the invoice. That way you avoid the mismatch of receiving money from one party and assigning credit to another, and you eliminate the risk of double invoicing or double VAT payments. Edited Friday at 01:15 PM by Kian 1 Quote Link to comment Share on other sites More sharing options...
Vulca Posted Saturday at 01:33 PM Author Share Posted Saturday at 01:33 PM Hi Kian, and thank you for your detailed and insightful answer. Actually, what I’m trying to build is a custom donation system — a dedicated public page where anyone (without having to create an account) could: Select the email address of an existing client (the beneficiary) Make a donation that generates a paid invoice in their name (the donor) Automatically credit the chosen client’s WHMCS account So in short: The donor gets a proper invoice (with their own name/email) The client receives the funds as credit and can use it for hosting payments But here’s the problem I’m facing: I haven’t found any module or extension that can achieve this flow cleanly. When I try to do it via WHMCS API or hooks, it always requires the donor to have a client account. Worse, the default viewinvoice.php reveals private billing info (name, address, etc.) even if someone just knows the client’s email — which creates serious privacy issues. Even ChatGPT-based attempts didn’t help, as it still ends up requiring account creation or exposes client data via the invoice template. Do you have any idea how to achieve this securely? Or maybe a cleaner architecture to replicate this behavior (perhaps via credits, coupons, or custom gateways)? Thanks again! 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted 9 hours ago Share Posted 9 hours ago I'd avoid using user credit in WHMCS, it's a potential source of accounting and tax issues. The presence of the AddCredit API command might make it look like a simple solution, but it's not appropriate for this use case. Here's why. WHMCS incorrectly treats credit top-ups as tax-exempt and applies taxes only when the credit is used. It works in US where credit is a liability and not an income but the rest of the world works differently. Taxes are due at the time of payment. This means a donor who pays 12 euro (with a 20% tax rate) should receive an invoice for 10 + 2 tax. WHMCS, however, would issue a tax-free invoice, making it impossible to account for properly. At year-end, you'd be responsible for paying those taxes or risk non-compliance. It gets worse if tax rates change. A donation received in 2025 under a 20% rate could be taxed at 21% when used in 2026 (if VAT changes), leading to inconsistencies and headaches for your accountant. The better approach in my opinion is to create a dedicated donation page where registered users can donate directly to a beneficiary (identified by email). Each donation should generate a valid, taxable invoice (API CreateInvoice). When payment is confirmed (via InvoicePaid hook point), log the donation in a custom table (donations_log where you store donor_id, beneficiary_id, amount which should be SIGNED, comment and currency_id in case you have multiple currencies). You can optionally display donations in the beneficiary's client area on a new dedicated page. The "hardest" part, so to speak, is to modifiy invoice view so that the beneficiary sees a small box reminding him "Hey, you have 28 euro in donations available to redeem" (sum of donations_log.amount) with a big "Redeem now" button that, when pressed, does the following: - Reads the current invoice subtotal (eg. 30 euro) - Applies as much available donation credit as possible, up to the subtotal (eg. 28 if subtotal is 30, if credit exceeds subtotal, stop at 30) - Adds a negative line item to the invoice for the applied amount (eg. "Donation applied: -28 euro") with a simple INSERT INTO tblinvoiceitems - Simultaneously you insert the negative transaction in donations_log to record the -28 You'll end up with a perfectly correct invoice: - Game server renewal: 30 - Donation applied: -28 - Subtotal: 2 - 20% Tax: 0.40 - Total due: 2.40 Done. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.