To enable PayPal on your website, you need to have a registered business account at paypal.com and a bank account.
It is also necessary to obtain the PayPal unique identifiers — Client ID and Secret.
Please note: to use PayPal, the USD or EUR currency must be enabled on the website. You can set it up in Products → Currency rates.
Setting up PayPal and getting unique identifiers
Go to https://developer.paypal.com/ and log in.
Go to the page Dashboard → My Apps & Credentials and in the REST API apps section click on the Create App button.
Specify the App Name — you can use any name here. Select an account for test orders (Sandbox developer account).
Please note: if the sandbox developer account field is empty, you need to add the Sandbox accounts according to the instructions on the PayPal website.
Save the Client ID and Secret values from the Sandbox tab.
For the main account save the Client ID and Secret values from the Live tab.
Below settings should be the same for both modes (Sandbox and Live).
In the LIVE WEBHOOKS section, you need to create a hook to which PayPal will send data on the payment status. Click the Add Webhook button.
On the page that opens you must specify Webhook URL — the link where PayPal will send the data. For example, https://some_domain.com/payment/payPalREST/
.
Please note that the https protocol is mandatory and instead of some_domain.com
, you must specify the domain of the site to which PayPal connects.
The following boxes must be checked in the Event Types block:
Payment sale completed
Payment sale denied
Payment sale pending
Click on Save to submit the hook settings.
Connecting PayPal to your website
You can enter the Sandbox account details in your website settings to test the operation of online payments. Then you need to replace them with the Client ID and Secret from the main (Live) account.
To connect PayPal to your website:
In the site admin panel, go to Settings → Payment providers.
Enter the Client ID and Secret in the corresponding fields of the PayPal block.
Click Save.
Enabling payment via PayPal for customers
Go to the Settings → Payment methods section in the admin panel and click the PayPal option.
Make sure that PayPal Native is selected in the Type field.
If necessary, set a custom Title for the payment method and edit the settings.
Activate the payment option by checking the Active checkbox.
Click Save.
Enabling PayPal option for the checkout
After connecting and setting up, you need to select which delivery options this payment method will be available for:
Go to the Settings → Shipping methods and carriers section and click on the desired method to edit the settings.
In the Payment section, check the PayPal checkbox.
Click Save.