# Paystack Setup

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

* PAYSTACK\_PUBLIC\_ID
* PAYSTACK\_KEY\_SECRET
* PAYSTACK\_BASE\_URI=<https://api.paystack.co>
* PAYSTACK\_WEBHOOK\_URI=<https://YOURDOMAINNAME/webhooks/paystack>

<div align="left"><figure><img src="https://1156155356-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fpb8ANp0ZN6ZvWH8LcR5c%2Fuploads%2FljYkwCxHEZVO6QWhVEHo%2FScreenshot%202024-06-20%20at%207.40.31%E2%80%AFPM.png?alt=media&#x26;token=f3d7b152-922d-4b70-b9bc-1c9446cd65c8" alt=""><figcaption></figcaption></figure></div>

### **How to get Paystack webhook and Add Events:**

* **Login to Paystack Dashboard:**
  * Go to [Paystack Dashboard](https://paystack.com/).
  * Enter your credentials and log in.
* **Navigate to Developers > Webhooks:**
  * On the left-hand menu, click on **Developers**.
  * Then select **Webhooks** from the dropdown menu.
* **Create a New Webhook Endpoint:**
  * Click on the **Create New Webhook Endpoint** button.
* **Configure Webhook Endpoint:**
  * Enter your webhook endpoint URL in the provided field.
    * Example: `https://yourdomain.com/webhooks/paystack`
    * Replace `yourdomain.com` with your actual domain name.
* **Add Webhook Events:**
  * Scroll down to the **Events to Send** section.
  * Add the following two events by clicking on **Add an Event** and selecting them from the dropdown:
    * `charge.success`
    * `subscription.disable`
* **Save Webhook Endpoint:**
  * After adding the events, click on the **Save Webhook** button to save your configuration.
* **Copy Webhook Secret Key:**
  * Once saved, Paystack 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/paystack`) into the respective field.
  * Also, paste the webhook secret key that you copied from Paystack into the designated field in your script's admin panel.
