# Wave

> Set up Wave Checkout on your own Wave business wallet in the Gambia, Senegal or Côte d'Ivoire: create the API key, add the signed webhook and paste its secret.

Source: https://docs.centipidbilling.com/billing/payment-gateways/wave

## Collect payments with Wave

`WAVE` sends the payer to **Wave Checkout**. The Wave app opens on their phone,
they approve the amount, and they are sent back to the captive portal.

Centipid Billing creates a Wave Checkout Session, sends the payer to its Wave
link, and confirms the result on a signed webhook that is re-checked against
Wave before anything is credited.

The money goes into **your own Wave business wallet**. Centipid Billing never
holds it. Offered in the country catalog for the Gambia, Senegal and Côte
d'Ivoire.

## Before you start

1. Open a Wave Business account owned by the ISP and finish verification.
2. Your Centipid Billing account must bill in `GMD` (Gambia) or `XOF` (Senegal and Côte d'Ivoire).

## Configure the gateway

#### Open Settings → Payments → Wave

Select Wave from the payment marketplace.

#### Create an API key

In the Wave Business portal, open **Developers → API keys** and create a
key that can create Checkout Sessions. Paste it into **API key**.

#### Add the webhook

Copy the **Webhook URL** shown under Callback URLs. In Wave, open
**Developers → Webhooks**, add it with the **signing secret** strategy, and
paste the secret Wave shows into **Webhook secret**.

#### Run a controlled test payment

Pay a small amount from the captive portal on a device that is not logged
in, and confirm the payment reaches the ledger and the subscriber connects.

## Credentials

| Field | Required | Notes |
|---|---|---|
| API key | Yes | Secret. From **Developers → API keys** in the Wave Business portal. |
| Webhook secret | Yes | Secret. Shown when you add the webhook in Wave. |

Both fields gate the switch.

## Callback URLs

| Name | Path |
|---|---|
| Webhook URL | `https://<your-host>/api/wave/callback` |

The payer's browser returns to `https://<your-host>/api/wave/return` after
paying or cancelling. Centipid Billing sends that address with every payment,
so there is nothing to register for it.

## How a payment completes

1. Centipid Billing creates a Wave Checkout Session for the amount, in whole
   units (`GMD` or `XOF`), tagged with our own reference.
2. The payer approves in the Wave app and is sent back to the return page.
3. Wave posts `checkout.session.completed`. Its `Wave-Signature` header is
   checked (a signature older than five minutes is refused), then the session
   is read back from Wave. Only a session whose payment status is `succeeded`
   records a payment and applies the package. A repeated webhook updates the
   same payment rather than crediting it twice.

A cancelled or expired checkout records nothing and the subscriber stays
disconnected. If Wave's API cannot be reached when a webhook arrives, Centipid
Billing answers with HTTP 503 so Wave sends it again later.

## Troubleshooting

| Symptom | What it means | What to do |
|---|---|---|
| *"Unable to process payment. Please try again later."* | The API key is missing, lacks permission, or Wave refused the session. | Check the key and that the account is verified. |
| Payments succeed in Wave, ledger stays empty | Webhooks are being rejected or not sent. | In Wave, open the webhook log. A 400 means the secret is wrong: re-copy it. It can also mean the webhook uses Wave's shared-secret option instead of the signing secret: edit the webhook and choose **signing secret**. |

For every gateway's fields in one place, see the
[credential reference](https://docs.centipidbilling.com/billing/payment-gateways/credentials-reference).
