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

  1. Download the ZIP package.
  2. Extract the ZIP file locally.
  3. Upload the extracted modules folder into the WHMCS root directory.
  4. Open WHMCS Admin.
  5. Go to System Settings > Payment Gateways.
  6. Activate Royat Pay.
  7. 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

  1. WHMCS renders the Royat Pay gateway on the invoice payment page.
  2. The module calls /api/payment/initiate-session.
  3. The module loads /royatpay.js and renders the embedded checkout inside WHMCS.
  4. After the customer chooses a payment method, the module calls /api/payment/execute using SessionId.
  5. If verification is required, the verification page opens inside the WHMCS invoice page.
  6. After return, the module calls /api/payment/status and 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.