This is the early access documentation preview for Custom Views. This documentation might not be in sync with our official documentation.
PayPal payment connector
Learn how to add a PayPal payment connector to your Project.
Add a PayPal payment connector
Before you add a PayPal payment connector, do the following:
- Create a PayPal application from its Developer Dashboard, and after the application is generated, copy the Client ID and Application secret.
For more information on how to create a sandbox environment, see Sandbox accounts. - Create a Composable Commerce API Client with the Orders, Payments, and Types scopes selected.
These permissions are required to establish a communication between Composable Commerce and commercetools Checkout.
To add a PayPal payment connector, you must:
Configure a PayPal payment connector
In the Merchant Center main navigation, click commercetools Checkout > Add payment connector.
On the Configure payment connector page, do the following:
From Select payment provider, select PayPal.
In the General information section, for Payment connector name, enter a plain-text name for the payment connector.
In the Configuration section, do the following:
- For PayPal Client ID, enter the PayPal client ID you generated while creating a PayPal application.
- For Environment, select the environment where you will use the payment connector.
In the Payment method section, keep the PayPal toggle in the activated position.
In the API client credentials section, do the following:
- For Client ID, enter the client ID you generated while creating the Composable Commerce API Client.
- For Client secret, enter the client secret you generated while creating the Composable Commerce API Client.
Click Save.
Set up a PayPal webhook
PayPal uses webhooks to call back the commercetools Checkout application and provide notifications about the status of the payment process.
To set up a webhook, follow the steps in PayPal documentation and enter the following configuration values:
URL:
https://pypl.checkout.{region}.commercetools.com/{PaymentConnectorID}/notifications
. Replace{region}
with the Region where your commercetools Checkout project is deployed (for example,europe-west1.gcp
) and{PaymentConnectorID}
with the payment connector ID you generated earlier.Event: select the following events to listen to:
- NotificationEventType.PAYMENT_CAPTURE_DECLINED
- NotificationEventType.PAYMENT_CAPTURE_COMPLETED
- NotificationEventType.PAYMENT_CAPTURE_REFUNDED
- NotificationEventType.PAYMENT_CAPTURE_REVERSED
Finalize the configuration of the PayPal payment connector
In the Merchant Center navigation menu, select commercetools Checkout > Payment connector list.
Select the payment connector you created earlier.
In the PSP specific connector secrets section, do the following:
- For Application secret, enter the PayPal application secret you generated while creating a Paypal application.
- For Webhook ID, enter the webhook ID you generated while setting up the PayPal webhook.
Click Save.
After adding the PayPal payment connector, add the activated payment method for this payment connector to your application.