> For the complete documentation index, see [llms.txt](https://cookbook.denovolab.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cookbook.denovolab.com/configuration/configuring-payment-gateway/paypal-configuration.md).

# Paypal Configuration

In this section, we will go through how to configure your Paypal account to work with your Class 4 installation.

Step 1: Go to developer.paypal.com

![](/files/-MXmdUv3vjbaWf37y1ED)

#### Step 2: Go to "My Apps & Credential"

In this section, you need to create an APP.  You can crate either a Sandbox or Live APP.  Sandbox will accept test account and test credit card.  Live APP only accept real paypal account and real credit card.&#x20;

![Create an APP](/files/-MXmdiheZtX6lglhoNT8)

#### Step 3: Fill out APP details

![](/files/-MXme6ht5rUQDMqOSZBs)

#### Step 4: Review your APP information

![](/files/-MXmecixixs4QP8cvFL3)

This Client ID and Secret should be placed inside the Paypal section like below:

![](/files/-MXmerThYM35GtBXu14Z)

Here you can select to charge the total amount that the user paid or the amount that actually got credited to your paypal account after the Paypal fee. &#x20;

If you select "Enable Paypal Test Mode", Class 4 will send query to the Paypal Sandbox URL instead of the Live Paypal URL.

#### Step 5: Specify Webhook and select the events that Class 4 needs

In the APP setting, you also need to setup Webhook.  This webhook is needed for Paypal to tell Class4 when a user has paid.&#x20;

![Webhook Setting](/files/-MXmfUp5hhdsWoKKOIlJ)

In the Paypal Webhook URL, you copy that URL.

![](/files/-MXmfjCJOo9wLdcGZa7P)

Then, you enter that webhook URL to the following:

![](/files/-MXmg3FQk4YhGERIGvCx)

You can set "all" but Class 4 only expects 'PAYMENT.SALE.COMPLETED' in fact.&#x20;

## Troubleshoot

You must use HTTPS and a domain name when setting up webhook in Paypal.  That means your Class 4 portal must be setup with a https domain url.  Otherwise, Paypal will complaint the following error:

![](/files/-MZuh5IyvSgX3bpYSPwe)
