How to set up PayPal - Modern

1. Setting up PayPal Accounts with Payments2Us

1.1. Login into PayPal Developer

1.1.1. Go to https://developer.paypal.com

Click on the "Log into Dashboard" button on the top right

1.1.2. Login into PayPal dashboard

  1. If you already have a PayPal Account, then use your production username/password.  
    You'll have the option of selecting a sandbox/test unstance later.
  2. If you do not currently have a PayPal Account, then select the Sign Up option.  
    Please make sure you select a "For Your Business" account type.
    After setting up a new account, you will need to return to https://developer.paypal.com

1.2. Set up a test (sandbox) version of PayPal

A sandbox instance is useful if you wish to test the PayPal integration.
We recommending testing PayPal and your processes prior to setting up a live account.

1.2.1. Select 'Sandbox' > 'Accounts' in the left menu

1.2.2. Create Sandboxes

  1. If you have some accounts already, then you can use these accounts for testing
  2. Or, if you'd prefer, you can create your own Sandbox accounts.

We would recommend having one account as a BUSINESS Type and one account as a PERSONAL type.

The BUSINESS Type is used to emulate your business (i.e. an organisation that is selling and collecting funds).

The PERSONAL Type is used to emulate a buyer or person that is purchasing goods from the BUSINESS account.

1.3. Create a PayPal App

click back to your Dashboard, click on in the My Apps and Credentials. Scroll down toe the REST API apps section and click "Create App"

1.3.1. Name your app, and select your Seller account and then click Create App.

  1. Enter in an App Name
  2. Select your sandbox.  This will be the BUSINESS Type
  3. Press Create App

1.4. Locate your PayPal Credentials

1.4.1. Locate your PayPal App

Navigate to Dashboard > My Apps & Credentials.

Scroll down the screen to the REST API apps and click into the App.  Note, the App was setup in the previous step of this manual

1.4.2. Copy your PayPal Credentials

Note, this is the same area you go to get your Sandbox or Production details.  Select radio button (1) to toggle between the two

Warning, keep these details secure.  Do not email these details to anyone.

  1. Toggle between Sandbox or Live
  2. Client Id will become the username.  Copy this to something like notepad.  You'll need this shortly
  3. The Show/Hide Link will reveal or hide the Client Secret.  If you cannot see the Secret area, then press "Show" link
  4. Client Secret will become the password. Copy this to something like notepad.  You'll need this shortly

1.5. Enter details into Salesforce

1.5.1. Enter PayPal Credentials into Salesforce

In Salesforce, locate your Merchant Facility that you wish use.

Edit merchant facility and update the credentials in the PayPal Section

Copy the Client ID code and Secret code. These were located in the previous section of this manual "Locate your PayPal Credentials"

Ensure you select the correct PayPal Environment

1.5.2. Enable PayPal method of Payment

On the Merchant Facility, you can now add "PayPal" as a method of Payment.

If you don't wish to make PayPal available for all Payments Forms, then you can create a URL Token with PayPal Selected there.  Then exclude PayPal as an option on the Merchant Facility.

You can configure Payments2Us to work with a PayPal Sandbox (Test) account or Production account.  Payments2Us supports PayPal offerings that support the PayPal Express Checkout option.

2. Setting up PayPal for Recurring Payments

To use recurring payments, you'll need to have a PayPal Recurring License.  Please contact info@payments2us.com for a key.

PayPal webhooks are used to communicate PayPal notifications such as a user canceling their service, a successful payment or failed payments.

The webhooks will either create a Payment Txn record in Salesforce for payment related activities, or will update the Recurring Payment object status for Billing Agreement related updates.

2.1. Locate the PayPal Webhook

In Salesforce, navigate to the Merchant Facility.  Click into the Merchant Facility you wish to use, then locate the Payment Form you wish to use form the related lists.

Click into the Payment Form

Scroll down to the Orders/Supplies/Payments section

Copy the PayPal Webhook URL.  You'll need this for the next step.

2.2. Add Webhooks to PayPal

2.2.1. Log into PayPal Developer

Goto website: https://developer.paypal.com

Login (top right) using your production PayPal Username/passwords

  • Click on "My Apps & Credentials" under the Dashboard heading (on the left side)
  • Scroll down to the REST API apps section
  • Click on to the App (Created in the Setting up PayPal Accounts with Payments2Us section of this manual)

2.2.3. Select Sandbox or Live

2.2.4. Add Webhook

Scroll down to the Webhook Section and press the "Add Webhook" button

2.2.5. Enter Webhook Details

  1. Enter the webhook URL as copied from Salesforce Payment for as per this User Manual step Locate the PayPal Webhook
  2. Select the following Event Types
    - Billing subscription cancelled
    - Billing subscription suspended
    - Payment sale completed
    - Payment sale pending
    - Payment sale denied

Press SAVE after entering these details

2.2.6. Copy webhook Id

Select the Webhook Id and copy this.  You'll need this for the next step

2.2.7. Update Payment Form Webhook Secret Key

Paste the copied webhook id into the Webhook Secret Key section on the Payment Form.  This must be the same Payment Form for where the PayPal Webhook was copied in earlier steps in this procedure.