# 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

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmdUv3vjbaWf37y1ED%2Fimage.png?alt=media\&token=61092788-8984-4441-a4e5-8239f20d4d7c)

#### 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](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmdiheZtX6lglhoNT8%2Fimage.png?alt=media\&token=019a9425-b387-4deb-98c1-095edf1dc773)

#### Step 3: Fill out APP details

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXme6ht5rUQDMqOSZBs%2Fimage.png?alt=media\&token=904cffd8-582e-4bd9-96bb-d6b5720be32e)

#### Step 4: Review your APP information

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmecixixs4QP8cvFL3%2Fimage.png?alt=media\&token=7b732940-f777-421b-ba75-424e926e33d5)

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

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmerThYM35GtBXu14Z%2Fimage.png?alt=media\&token=e7a93539-3e01-4520-8e5d-ecb514655a8e)

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](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmfUp5hhdsWoKKOIlJ%2Fimage.png?alt=media\&token=adfd5f10-9887-4022-b034-08525bcb33e2)

In the Paypal Webhook URL, you copy that URL.

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmfjCJOo9wLdcGZa7P%2Fimage.png?alt=media\&token=fa815555-1d05-4e5d-b94c-f86ae5d2fdb3)

Then, you enter that webhook URL to the following:

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MXmcNoG0Jyc-H6k7q0D%2F-MXmg3FQk4YhGERIGvCx%2Fimage.png?alt=media\&token=575f3a0d-10a5-4116-be6c-c92b1e58492d)

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:

![](https://4102392624-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MXPCJcszvw7MAuHjiRr%2F-MZugEBUN2sySwXEbJBO%2F-MZuh5IyvSgX3bpYSPwe%2Fimage.png?alt=media\&token=1df09e41-df05-4358-b03c-d559c15fe79a)
