Payments made through the Public Pay module do not generate invoices. Once the payment has been validated by the gateway, the full amount is added directly to the client's WHMCS credit balance. This core behavior allows for flexible, invoice-independent payments that increase the available credit a client can use toward future invoices.
Administrators benefit from this by reducing invoice clutter while ensuring all payments are accounted for in the client's ledger. The validation step is critical, as it confirms the legitimacy of the transaction before crediting the account and prevents fraudulent additions to balances.
#Overview of the Public Pay Module
Designed for ease of use, the Public Pay module enables anyone to make a payment toward a specific client account without needing to be logged in or to have an outstanding invoice. It is commonly used for courtesy payments, prepayments, overpayments, or when directing customers from external invoices or estimates. Integration with standard WHMCS payment gateways ensures that a wide variety of payment methods are supported. Because the module operates outside the normal invoice-payment pairing, its behavior differs from typical transactions by treating every successful payment as a credit deposit rather than a settlement against a billed item.
#Payment Processing and Credit Addition Steps
The process follows a defined sequence to ensure security and accuracy:
- Payer navigates to the Public Pay URL and specifies the client account along with the desired payment amount and any required identifying information.
- Payment information is collected through a secure form and sent to the configured gateway for authorization.
- The gateway performs validation, which may include address verification, 3D Secure checks, or bank confirmation depending on the method used.
- Successful validation triggers an immediate callback or IPN notification to WHMCS confirming the transaction status.
- WHMCS records the transaction in the system logs and adds the paid amount in full to the designated client's credit balance without creating or linking to any invoice record.
#Benefits and Considerations of Credit-Only Payments
Avoiding invoice generation prevents unnecessary entries in the billing system that would otherwise require manual management or reconciliation. Client credits in WHMCS function as a general ledger balance that the system automatically applies to the oldest outstanding invoices first when they become due. This mechanism promotes a cleaner database, simplifies financial reporting, and gives clients a running credit that can be drawn against at any time. However, it requires that support staff educate clients on how their payments affect their account if they expect a specific invoice to be marked as paid rather than having a credit applied.
#Verifying Transactions and Managing Balances
After a payment posts, review the client's profile in the WHMCS admin dashboard to confirm the credit increase under the Summary or Credit tab. Transaction history will show the payment under the relevant gateway with a clear note that it was processed via Public Pay. If discrepancies arise, the gateway and module logs can help identify whether the issue occurred during validation, in the callback handling, or in the credit application step. Administrators can also manually adjust credit balances when required through the built-in tools.
/* Sample WHMCS PHP Hook to log Public Pay credits */
add_hook('AddCredit', 1, function($vars) {
if (strpos($vars['description'], 'Public Pay') !== false) {
logActivity('Public Pay credit added for client #' . $vars['clientid'] . ': ' . $vars['amount']);
}
});
Common pitfalls include gateway configuration errors that prevent proper callbacks from firing, resulting in payments that appear successful to the client but never reach the credit balance. Clients may also enter incorrect account identifiers, causing credits to post to the wrong profile. Test all gateways with small amounts in a development environment first. Set clear expectations on your payment page regarding how and when funds will be applied as credit rather than to a specific invoice.
Takeaway: The Public Pay module streamlines deposits by routing validated payments straight to credit balances without invoice overhead. Combine this with routine account audits, transaction log reviews, and proper gateway setup for reliable operations. Check the module configuration options in your WHMCS admin panel for any custom adjustments needed for your billing workflows.
Comments
No comments yet