To install the Apple Pay Gateway for WHMCS, first configure Braintree to support Apple Pay by following their official guide. Then download the ASPnix module and licensing system, upload them to your WHMCS root directory, activate the gateway in the WHMCS admin area, input your Braintree merchant ID, public and private keys, your Apple Pay merchant ID, and ASPnix product license. Finally add the invoice_id and user_id custom fields under Braintree Processing Settings. Always test thoroughly in sandbox mode first, as the API details for sandbox and production are different.
Apple Pay integration gives customers using Apple devices a fast, secure checkout that requires no manual card entry. The ASPnix module handles the WHMCS side while Braintree processes the transactions. Adding the two custom fields ensures payments map correctly to invoices and user accounts, eliminating manual reconciliation work and reducing errors in your billing workflow.
#Prerequisites
- Fully installed WHMCS system with administrator access
- Active Braintree merchant account with API keys enabled
- Apple Developer account and approved Apple Pay merchant identifier
- Valid ASPnix product license for the gateway module
- FTP or file manager access to upload files to the WHMCS web root
#Braintree and Apple Configuration
Set up Apple Pay in Braintree before installing anything in WHMCS. Follow the steps in the Braintree developer article at https://developers.braintreepayments.com/guides/apple-pay/apple-pay-on-the-web/javascript/v3. The process registers your domain with Apple, generates the payment processing certificate, configures the JavaScript SDK, and verifies your merchant identity. This step is non-negotiable; Apple enforces strict domain validation and any mismatch will prevent the Apple Pay button from appearing or transactions from completing.
#ASPnix Module Installation
Download the latest build of the Apple Pay module for WHMCS together with the ASPnix licensing system. Extract the archive locally, then upload every file to your WHMCS web root or document root. The licensing files must sit in the root directory; placing them elsewhere will cause validation failures and the module will not load.
#Activating and Configuring the Gateway in WHMCS
Log into the WHMCS administrator area and navigate to Setup => Payments => Payment Gateways. Locate the Apple Pay module in the list and activate it. In the configuration screen that appears, enter your Braintree merchant ID, Braintree public key, Braintree private key, the Apple Pay merchant ID obtained from the Apple Developer portal, and your ASPnix product license key. These values are environment-specific, so double-check them before saving. Click Save Changes to store the settings and enable the gateway for client-area use.
#Adding Custom Fields in Braintree
Braintree requires two custom fields so the ASPnix module can pass WHMCS-specific identifiers with each transaction. Without them, payments cannot be automatically matched to the correct invoice or customer record.
In the Braintree control panel, go to Processing Settings, find the Custom Fields section, and click Add New for each field. Name the fields exactly as invoice_id and user_id. These fields act as metadata containers that the module populates during checkout, allowing WHMCS to mark invoices paid and update client accounts without manual intervention.
#Testing and Going Live
It is highly recommended that you test in a sandbox environment first. Create a separate set of Braintree sandbox credentials and an Apple Pay sandbox merchant ID. Perform end-to-end tests from the WHMCS client area using Safari on a registered Apple device. Verify that the Apple Pay sheet appears, authentication succeeds, the transaction appears in Braintree with the correct custom fields populated, and the corresponding WHMCS invoice is marked paid.
Sandbox and production use completely different merchant IDs, keys, and certificates, so never mix them. After successful sandbox testing, replace the credentials with production values and repeat a final verification. Monitor the first few live transactions for any callback or webhook issues. With the gateway active, customers gain a modern, frictionless payment option that matches expectations for Apple device users.
Comments
No comments yet