(Classic) PayPal

   END-OF-LIFE ANNOUNCEMENT This article describes PayPal integration with version 1 of the Payment API. The Classic Online Experience with Payment API version 1 will be decommissioned at the end of 2024. All Payment API integrations should migrate to version 2, the Enhanced Online Experience, by January 2025.

PayPal for FinDock is a payment extension for PayPal, the well-known global online Payment Service Provider (PSP). The payment extension supports one-time and recurring payments.

Multi-merchantMulti-currency
Payment MethodOne-timeRecurringRefunds
PayPal

Pre-requisites

  • FinDock installed and configured
  • A source connector installed and configured
  • A Salesforce Site configured

    To be able to configure and use recurring payments in PayPal for FinDock, you need to have Reference Transactions enabled in your PayPal account. You may need to contact PayPal Customer Service to get this feature enabled in your account.

Install and activate PayPal for FinDock

Follow the standard procedure for installing and activating the PayPal for FinDock payment extension.

Create a PayPal app

You need to create and configure a PayPal app before you can complete the PayPal for FinDock configuration. Some information from the PayPal app settings needs to be copied to the Paypal for FinDock extension settings. You can complete the PayPal app configuration first and then move onto the FinDock configuration, or do them in parallel.

To create a PayPal app:

  1. Sign up or log in to https://developer.paypal.com.
  2. Click My Apps & Credentials in the left-hand menu.
  3. Toggle the Sandbox or Live (production) button according to the type of org you are configuring and click Create App. paypal_account_new_app-1024x479
  4. Fill in a name for the app and click Create App.
  5. Two values from the app credentials need to be added to the respective PaymentHub-PayPal setting fields in FinDock. paypal_app_clientid_secret-1024x550
    • Copy-paste Client ID into the PayPal API Client Id field in FinDock.
    • Click Show to reveal your app secret and copy-paste this value into the PayPal API Secret field in FinDock.
  6. Scroll down to the bottom of the PayPal app settings page and click Add Webhook.
  7. As the webhook URL, add your Salesforce Site URL + /services/apexrest/pp4ph/PayPal/webhooks/v1/. Use https. Example: https://sandbox-paymenthub-developer-edition.cs89.force.com/services/apexrest/pp4ph/PayPal/webhooks/v1/
  8. Check following event types:
    • Billing subscription cancelled
    • Payment capture completed
    • Payment capture refunded
  9. Scroll down to the bottom of the event types list and click Save. You are redirected to the app home page.
  10. Scroll down to the webhooks section and copy-paste the Webhook ID of the webhook you just added into the PayPal Webhook Id field of the PayPal settings in FinDock. paypal_app_webhook-1024x429

Configure PayPal for FinDock

If you are not there already, log in to your PayPal developer account and open the app you configured for the PayPal for FinDock extension. You need to copy some information from the app settings to the PayPal for FinDock settings.

To configure PayPal for FinDock:

  1. Add the following permission sets to Site Guest User:
    • PaymentHub Integration Base
    • PayPal FLS
    • ProcessingHub Operations
  2. Launch the FinDock app and click the Setup tab.
  3. Go to the Remote Site Settings tab and activate one of the PayPal endpoints.
    • PayPalProductionEndpoint: activate this endpoint if you are configuring a production org.
    • PayPalTestEndpoint: activate this endpoint if you are configuring a sandbox org for testing.
  4. Click the FinDock Setup tab to go back to the home page and then click on the PaymentHub-PayPal tile under the section Extensions - PSP. paypal_findock_settings-1024x442
  5. Fill in the PayPal settings from your PayPal app and click Save.
    • Site URL: your Salesforce Site URL, starting with https:// and ending with /. Example: https://sandbox-paymenthub-developer-edition.cs89.force.com/
    • Client Id, Secret, Webhook Id: copy-paste these from your PayPal app settings (see above).
    • Default Billing Agreement Description: for details on PayPal billing agreements, see the PayPal developer docs.
    • isTest: activate if you are configuring a sandbox org for testing.

Testing with the Payment API

You can use the following example messages to test if the PayPal configuration is working as expected.

One-time payment with PayPal

    {
        "SuccessURL":"http://www.success.nl",
        "FailureURL":"http://www.fail.nl",
        "Payer":{
            "Contact":{
                "FirstName":"T",
                "LastName":"Tester",
                "Email":"Test@work.com"
            },
            "AccountUpdate":"Enrich",
            "ContactUpdate":"Enrich",
            "AllowDeduplication":false,
            "PrimaryRelation":"Contact"
        },
        "Payment":{
            "Amount":10
        },
        "PaymentMethod":{
            "Name":"PayPal",
        "Processor" :"PaymentHub-PayPal"

        },
        "SourceConnector":{
            "Name":"PaymentHub"
        }
    }

Recurring payment with PayPal

    {
        "SuccessURL":"http://www.success.nl",
        "FailureURL":"http://www.fail.nl",
        "Payer":{
            "Contact":{
                "FirstName":"T",
                "LastName":"Tester",
                "Email":"Test@work.com"
            },
            "Account":{
                "Name":"Famylje Douwstra"
            },
            "AccountUpdate":"Enrich",
            "ContactUpdate":"Enrich",
            "AllowDeduplication":false,
            "PrimaryRelation":"Contact"
        },
        "Recurring":{
            "Amount": 10.15,
            "Frequency":"Monthly",
            "StartDate":"2017-11-01"
        },
        "PaymentMethod":{
            "Name":"paypal",
            "ParameterMap": {
            "RequiresAuthorization":"true"
            }
        },
        "SourceConnector":{
            "Name":"PaymentHub"
        }
    }

Was this page helpful?