# WHMCS

The IntaSend gateway module lets your WHMCS clients pay their invoices with M-Pesa, card and the other
methods enabled on your account. Checkout runs on IntaSend's hosted payment page.

- **Module:** [intasend-whmcs-plugin.zip](https://intasend-public-share.s3.eu-central-1.amazonaws.com/intasend-whmcs-plugin.zip)
- **Needs:** WHMCS, and your IntaSend publishable and secret keys

## 1. Upload the module

Unzip the file and upload the two `intasendpayment.php` files to your WHMCS installation:

| From the zip | Upload to |
|---|---|
| `intasendpayment.php` | `modules/gateways/` |
| `callback/intasendpayment.php` | `modules/gateways/callback/` |

## 2. Activate it

In the WHMCS admin, go to **Setup → Payments → Payment Gateways → All Payment Gateways** and click
**IntaSend Payments**. This opens the module's settings.

## 3. Add your keys

Copy your keys from **Settings → API Keys** in IntaSend and fill in:

| Setting | Value |
|---|---|
| Public Key | Your publishable key |
| Secret Key | Your secret key |
| Test Mode | Tick with [sandbox](https://sandbox.intasend.com/account/api-keys/) keys. Untick with [live](https://payment.intasend.com/account/api-keys/) keys. |

Click **Save Changes**.

## How it works

Unpaid invoices show a **Pay Now** button. It opens IntaSend checkout prefilled with the client's
name, email, phone and address, in the invoice's currency. The invoice ID is sent as the `api_ref`.
When the payment completes, the module checks its status with IntaSend and marks the WHMCS invoice paid.

Refunds can't be made from WHMCS. Raise them from your IntaSend dashboard or the [chargebacks API](https://developers.intasend.com/guides/chargebacks/).
