# Flutterwave Setup

**You need to enter your Flutterwave credentials in the Admin panel under Finance Manager -> Payment Settings -> Flutterwave. Ensure you include all your Flutterwave credentials and activate the Flutterwave checkbox(es).**

* FLUTTERWAVE\_PUBLIC\_KEY
* FLUTTERWAVE\_KEY\_SECRET
* FLUTTERWAVE\_SECRET\_HASH
* FLUTTERWAVE\_WEBHOOK\_URI=<https://YOURDOMAINNAME/webhooks/flutterwave>

<div align="left"><figure><img src="https://1156155356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fpb8ANp0ZN6ZvWH8LcR5c%2Fuploads%2FdOzwQSq62RgA5pnMXatt%2FScreenshot%202024-06-20%20at%207.53.20%E2%80%AFPM.png?alt=media&#x26;token=ed6d84a7-33a2-423d-8f6d-8a09a4571ace" alt=""><figcaption></figcaption></figure></div>

### How to Get Flutterwave Webhook and Add Events:

* **Login to Flutterwave Dashboard:**
  * Go to [Flutterwave Dashboard](https://flutterwave.com/).
  * Enter your credentials and log in.
* **Navigate to Webhooks:**
  * On the left-hand menu, click on **Settings**.
  * Then select **Webhooks** from the dropdown menu.
* **Create a New Webhook Endpoint:**
  * Click on the **Create New Webhook** button.
* **Configure Webhook Endpoint:**
  * Enter your webhook endpoint URL in the provided field.
    * Example: `https://yourdomain.com/webhooks/flutterwave`
    * Replace `yourdomain.com` with your actual domain name.
* **Add Webhook Events:**
  * Scroll down to the **Select Events** section.
  * Tick the checkbox for the following two events:
    * `charge.completed`: This event is triggered when a charge (payment) is successfully completed.
    * `subscription.cancelled`: This event is triggered when a subscription is cancelled.
* **Save Webhook Endpoint:**
  * After adding the events, click on the **Save** button to save your webhook configuration.
* **Copy Webhook Secret Key:**
  * Once saved, Flutterwave will generate a secret key for your webhook.
  * Copy this secret key as you will need it for configuring the Payment Settings page of your script.
* **Configure Payment Settings in Your Script:**
  * Go to the **Payment Settings** section in your script's admin panel.
  * Paste the webhook URL (`https://yourdomain.com/webhooks/flutterwave`) into the respective field.
  * Also, paste the webhook secret key that you copied from Flutterwave into the designated field in your script's admin panel.
