# Quick Setup Guide

### Paddle Configuration

Login to your Paddle Vendor Dashboard at [https://vendors.paddle.com](https://vendors.paddle.com)

**From the left sidebar, choose Checkout > Website Approval**

Click on Add a new domain and add your WHMCS domain, or subdomain

For example: if your WHMCS is hosted at billing.domain.com, enter that. Otherwise if it is hosted at domain.com/billing then enter domain.com and click on the Submit For Approval button

| Subdomain          | Directory  |
| ------------------ | ---------- |
| billing.domain.com | domain.com |

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2Fbzsiyv40R6t7A66iOLmN%2Fimage.png?alt=media&#x26;token=4a4f23c3-22a3-48e9-b188-161e1da95e8f" alt=""><figcaption></figcaption></figure>

**Then, from the left sidebar, choose Checkout > Checkout Settings**&#x20;

Set the Default payment link as below and save

For example: if your WHMCS is hosted at billing.domain.com, enter https://billing.domain.com/viewinvoice.php . Otherwise if it is hosted at domain.com/billing then enter https://domain.com/billing/viewinvoice.php

| Subdomain                                                                                | Directory                                                                                |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| [https://billing.domain.com/viewinvoice.php](https://billing.domain.com/viewinvoice.php) | [https://domain.com/billing/viewinvoice.php](https://domain.com/billing/viewinvoice.php) |

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2F7RtckJ7xsOfdFDlArm3f%2Fimage.png?alt=media&#x26;token=5695696d-706d-460e-b3a7-823d4e9a942a" alt=""><figcaption></figcaption></figure>

**Then, from the left sidebar, choose Checkout > Sales Tax Settings**

Select the Sales Tax Setting required and press Save Changes

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FiF9bEO2Zi1ITf3eUlpkY%2Fimage.png?alt=media&#x26;token=26306ef6-5799-487e-ad71-685342014520" alt=""><figcaption></figcaption></figure>

**Then, from the left sidebar, choose Developer Tools > Authentication**

Click on Generate API Key

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2Fb5P1Eqc4bMvWEggE5iXg%2Fimage.png?alt=media&#x26;token=e6991406-ca9c-4f3d-8ede-5c8175598292" alt=""><figcaption></figcaption></figure>

Give it a familiar name, and press the Generate button, copy the key as you will need it later when configuring the payment module in WHMCS

Next, click on Generate client-side token

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FVM2wQ9oupvP4cKIPBgkP%2Fimage.png?alt=media&#x26;token=ad6b9928-db58-4e0a-a75e-1d4e7a2cb209" alt=""><figcaption></figcaption></figure>

Give it a familiar name, and press the Generate button, copy the token as you will need it later when configuring the payment module in WHMCS

**Then, from the left sidebar, choose Developer Tools > Notifications**

**Click on New Destination**

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FuTLkw4ZVXoGXBPpOXV0W%2Fimage.png?alt=media&#x26;token=9a8247a7-d09e-436e-91c8-5684cb2b7cca" alt=""><figcaption></figcaption></figure>

Give it a familiar description, choose Webhook for notification type and for the URL it will be one of the below depending on your setup

| Subdomain                                                                                                                                    | Directory                                                                                                                                    |
| -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| [https://billing.domain.com/modules/gateways/callback/paddlelayer.php](https://billing.domain.com/modules/gateways/callback/paddlelayer.php) | [https://domain.com/billing/modules/gateways/callback/paddlelayer.php](https://domain.com/billing/modules/gateways/callback/paddlelayer.php) |

Under Events, choose the below 3 Events

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FGAU9W07pEAKDl8TQ6EQH%2Fimage.png?alt=media&#x26;token=4d57189a-52f2-4827-9f94-045921ed1880" alt=""><figcaption></figcaption></figure>

Press Save Destination.&#x20;

Now, click the ... button and click on Edit destination

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FO3PIL9YAgeMXGhz8XyXm%2Fimage.png?alt=media&#x26;token=7f88aa14-d434-4555-a55d-cc666e721e44" alt=""><figcaption></figcaption></figure>

Now copy the Secret Key, this will be the 'Notification Secret Key' which you will need when you configure the module in WHMCS.

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2Fge39zxXJnm6rFuL0Ycpf%2Fimage.png?alt=media&#x26;token=c50a68e4-e8e6-496e-be9a-1d73875e4d50" alt=""><figcaption></figcaption></figure>

Everything is ready and configured on Paddle side.&#x20;

### WHMCS Configuration

* Download the latest .zip of the Paddle module file from the Layer client area - https://my.layer.ae
* Unzip the .zip file and place the contents into the WHMCS directory
* Login to the admin side of WHMCS, and go to Setup > Apps & Integrations (as below)

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FWlvhIdwSgUTqHMkcUP5i%2Fimage.png?alt=media&#x26;token=a4a29286-bafc-498a-8233-b66a54db3c82" alt=""><figcaption></figcaption></figure>

* Click on Browse, and then click on Payments under categories, and look for the Layer Paddle Billing module

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2F9dKI4CSKRNp8iQJD8fdp%2Fimage.png?alt=media&#x26;token=9396f7d1-a1be-475f-af2d-2a0c32a5de6d" alt=""><figcaption></figcaption></figure>

* Click on Layer Paddle Billing, and then click on Activate

<figure><img src="https://1561801098-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNOJSY8C1b07htWrhozj2%2Fuploads%2FepJ749q6b3dkTZubdDyq%2Fimage.png?alt=media&#x26;token=571694a0-4b6e-494b-a6d9-c635906e0a0f" alt=""><figcaption></figcaption></figure>

* Fill in your Layer license Key, your Paddle API Key (from the previous steps), your Paddle Client Side Token (from the previous steps) and your Notification Secret Key
* Select the currency to charge in (this should be an enabled currency in your paddle account)
* Select the Paddle Sales Tax Setting
* If your WHMCS has multiple currencies, you have to set "Convert To For Processing" to match the charge currency

Congratulations! Everything is ready for you now. You can create a test invoice, and go through the flow.

{% hint style="info" %}
To use the sandbox mode, you need to register on the paddle sandbox environment at [https://sandbox-vendors.paddle.com](https://sandbox-vendors.paddle.com) the steps are the same - you only need to enable sandbox mode in the module setting in WHMCS for the module to use Paddle's sandbox environment.
{% endhint %}
