Integrate the Khalti Payment Gateway seamlessly into your WHMLAB-powered website with this easy-to-use plugin. This plugin enables secure, fast, and efficient transactions via Khalti, one of Nepal's most trusted payment platforms. It handles payment initiation, status updates, and IPN (Instant Payment Notification) responses to ensure a smooth payment experience for your users. Whether you're handling deposits or other transactions, this plugin provides an efficient solution for processing payments through Khalti.

Features:

# Seamless Payment Flow: Automatically redirects users to the Khalti payment page and handles success or failure notifications.
# Secure: Uses Khalti's secure API to process payments.
# Supports Multiple Currencies: Works with NPR currency supported by Khalti.
# Detailed Logs: Store payment details, statuses, and any error messages for debugging or auditing.
IPN Support: Automatically handles IPN (Instant Payment Notifications) to update payment statuses in real-time.

Installation Guidelines:

Install the Plugin

Download the plugin zip file and navigate to the App->Http->Controllers->Gateway directory in your WHMLAB setup.
Upload the Khalti.zip file here, which will create the Khalti folder and add the ProcessController.php file.

Update Routes

Open core/routes/ipn.php and add the following route:
Route::match(['get', 'post'], 'khalti', 'Khalti\ProcessController@ipn')->name('Khalti');

Add Gateway Information to Database

Go to phpMyAdmin and select your WHMLAB database.
Run the following SQL query to insert the Khalti gateway:


INSERT INTO `gateways` (`id`, `form_id`, `code`, `name`, `alias`, `image`, `status`, `gateway_parameters`, `supported_currencies`, `crypto`, `extra`, `description`, `created_at`, `updated_at`) 
VALUES (NULL, '0', '131', 'Khalti', 'Khalti', '68cc501a2f0d51758220314.png', '1', '{\"public_key\":{\"title\":\"Public Key\",\"global\":true,\"value\":\"live_public_key_33\"},\"secret_key\":{\"title\":\"Secret Key\",\"global\":true,\"value\":\"live_secret_key_0ef\"}}', '{\"NPR\":\"NPR\"}', '0', '{\"webhook\":{\"title\": \"Webhook URL\",\"value\":\"ipn.Khalti\"}}', NULL, '2025-09-18 18:09:26', '2025-09-19 00:18:34');
    

This will insert the necessary data to enable the Khalti payment gateway within your system.

Configure the Gateway Settings

#  Login to your WHMLAB admin dashboard.
#  Navigate to Payment Gateways and find Khalti.
#  Click Edit and enter your Khalti Public Key and Secret Key in the respective fields.
#  Ensure that the Webhook URL is correctly set to ipn.Khalti.

Verify Payment with Khalti

The plugin uses Khalti's API to initiate payments and verify their completion. It will redirect users to Khalti's payment page, and the status of the payment (success, failure, or canceled) will be sent to your system via IPN.

Test the Payment Process

Perform test payments to verify that the integration is working smoothly.
Check if the payment status updates correctly in your system (e.g., completed or failed payments).

Usage Guidelines:

  • Initiate Payment: The user will be redirected to Khalti's payment page when a deposit is made.
  • Payment Status: On successful payment, the system will automatically update the status of the transaction. If the payment is canceled or fails, the system will reflect the appropriate status.
  • Webhooks: The plugin listens for IPN (Instant Payment Notifications) from Khalti to process the payment verification in real-time.

Important Notes:

  • Ensure that your Khalti Public Key and Secret Key are correct. These credentials are required for successful payment initiation and verification.
  • Test payments are highly recommended before going live.
  • For security purposes, keep your Khalti Secret Key confidential.
Plugin Fee

The plugin is available for Rs. 1500/-
This fee includes lifetime updates.

Payment Information

Pay the plugin fee to:

SASA INFOSYS PVT. LTD.
eSewa: 9765085485
Remarks: WHMLAB PLUGIN

By following these steps, you'll have the Khalti payment gateway integrated into your WHMLAB platform, offering your users a secure and reliable payment option!