WHMCS Gateway
Royat Pay payment gateway module for WHMCS invoices
Overview
The Royat Pay WHMCS gateway lets WHMCS installations accept invoice payments through Royat Pay with an embedded checkout experience on the invoice payment page.
Branding: The module uses Royat Pay naming and Royat branding only.
WHMCS installations should use the Royat Pay client API token only. Do not place the central payment integration token inside WHMCS.
Package Location
The gateway source is available in the Royat Pay repository under:
packages/royat-pay-whmcs
Download the current ZIP package:
https://panel.royat.sa/downloads/royat-pay-whmcs.zip
Installation
- Download the ZIP package.
- Extract the ZIP file locally.
- Upload the extracted
modulesfolder into the WHMCS root directory. - Open WHMCS Admin.
- Go to
System Settings > Payment Gateways. - Activate
Royat Pay. - Set the Royat Pay URL, client API token, checkout title, and logo URL.
Settings
| Setting | Value |
|---|---|
| Royat Pay URL | https://panel.royat.sa |
| API Token | The client token from the Royat Pay dashboard. |
| Checkout Title | Royat Pay |
| Logo URL | https://www.royat.sa/wp-content/uploads/2024/03/logo_header1-1-Recovered.png |
Checkout Flow
- WHMCS renders the Royat Pay gateway on the invoice payment page.
- The module calls
/api/payment/initiate-session. - The module loads
/royatpay.jsand renders the embedded checkout inside WHMCS. - After the customer chooses a payment method, the module calls
/api/payment/executeusingSessionId. - If verification is required, the verification page opens inside the WHMCS invoice page.
- After return, the module calls
/api/payment/statusand marks the WHMCS invoice as paid when the payment is successful.
Main Account Settlement
If the WHMCS account should settle to the main Royat account, configure that client in Royat Pay with settlement
code 0. The WHMCS module still uses only the Royat Pay client token.
Files Included
modules/gateways/royatpay.php
modules/gateways/callback/royatpay.php
Current Package Status
This is the first internal package version. Test it on a staging WHMCS installation before giving it to production customers.