Liferay Commerce Connector to PayPal SDK

Liferay DXP 2024.Q4+/Portal 7.4 GA129+

Liferay provides a client extension that integrates with the PayPal JavaScript SDK to provide more payment options like Google Pay, Apple Pay, Venmo, Pay Later, etc. during checkout. This uses the payment integration client extension as a base.

Liferay also provides PayPal as a payment method out-of-the-box. This directs the user to PayPal to complete payment, whereas this SDK processes the payment without the user having to navigate away from Liferay. See Configuring Payment Methods to read more about the payment methods available out-of-the-box with Liferay.

Note

Currently, the PayPal SDK client extension is only compatible with Liferay SaaS.

To use this client extension, you must have a merchant ID and also generate a PayPal client ID and client secret. Visit the PayPal Developer Dashboard for more information.

Install and Deploy the PayPal SDK Client Extension

  1. Go to Liferay Marketplace and search for Liferay Commerce Connector to PayPal SDK.

  2. Click Get App, select your account or create one, and accept the end user license agreement and terms of service.

  3. Click Continue.

  4. Select a project from the ones available to you.

  5. Click Get App.

  6. Note the order ID. You must use it to install the app from your Cloud dashboard.

  7. Click Go to Console.

  8. Go to Services, and click New App.

  9. Enter the order ID from before and complete the installation.

  10. Log in as an administrator and verify that two OAuth Application User Agents and two OAuth Application Headless Servers were added to Liferay. Open the Global Menu (Applications Menu icon) and go to Control PanelOAuth2 Administration.

  11. Open the Global Menu (Applications Menu icon) and navigate to CommerceChannels.

  12. Select the channel and scroll down to the Payment Methods section.

  13. Click Liferay PayPal Commerce Payment Integration.

  14. Use the Active toggle to activate the payment method and click Save. Two new tabs for Eligibility and Configuration appear.

    Click the Eligibility tab to select specific order types or payment terms to be eligible for the payment integration. By default, it is eligible for all order types and payment terms.

    The Configuration tab contains can accept key-value pairs from your PayPal Developer Dashboard.

    Enter the key-value pairs from your PayPal dashboard to complete the integration.

    FieldDescription
    clientIdThe Client ID field from your PayPal dashboard.
    clientSecretThe Client Secret field from your PayPal dashboard.
    merchantIdThe Account ID field from your PayPal dashboard.
    modeUse sandbox or live depending on your configuration.
    webhookIdThe ID of the webhook created on your PayPal dashboard. This is optional.
  15. Click Save.

    PayPal is now enabled for your store.

  16. Open your site and use the account selector to create a new account.

  17. Add a few items to your cart.

  18. Open the mini cart and click Submit. This starts the checkout flow.

  19. Choose the Liferay PayPal Commerce Payment Integration method in the Payment Method step. If you didn’t have other active payment methods, this step appears directly. Use the desired payment option to complete payment.

Enter your payment details to complete the order.

Note

The above flow uses PayPal’s sandbox mode. PayPal provides numerous test card numbers to replicate different payment scenarios. See Card Testing for more information.

  1. Open the Global Menu (Applications Menu icon) and go to CommercePayments to verify the payment’s completion.

Capabilities

Product

Contact Us

Connect

Powered by Liferay
© 2024 Liferay Inc. All Rights Reserved • Privacy Policy