Paypal Integration


DEAR generates electronic documents (PDF, e-mail content) to enable your customers to seamlessly pay quotes and invoices. Payment documents can contain Pay Links, a link which takes customers through the DEAR Payment workflow. DEAR supports Stripe and Paypal as payment processors, and one payment document can contain links to both payment processors. See how to pay with Stripe. 


Prerequisites

  • Paypal Business Account (necessary)


  1. Paypal Integration Setup
  2. Add a PayPal Link to a Payment Document
  3. Payment Document Information



Paypal Integration Setup

[back to top]


You first need to establish a connection between DEAR and a PayPal Business Account to enable PayPal as a payment processor.



Setup in Paypal

[back to top]


First, you will need to get some information from your PayPal Business Account and get API Keys to connect to DEAR. 


To setup PayPal:

  1. Go to your PayPal Business Account Profile Page and copy your Merchant ID (PayPal Account ID).


  1. Create PayPal Business Account integration keys (REST API keys) for DEAR at the Developer Dashboard. (See PayPal Docs here). 
  2. Choose the PayPal Account that will be used in sale payment/prepayment lines.
  3. You will need the Client ID and the Secret Key to connect DEAR to your PayPal Business Account. 




Connect to DEAR

[back to top]



To connect Paypal to DEAR:   

  1. Navigate to Integration -> Paypal

  1. Enter your Merchant ID and API details and click Connect to PayPal

  1. Here you can test payments and set which account will be linked to PayPal payments. You can also disconnect from PayPal
  2. Your PayPal account is now connected and can be used to send and receive payments. 



Adding a PayPal PayLink to a Payment Document

[back to top]


There are two ways to insert Pay Link into a document template: with a standard Pay Link image and with a custom Pay Link image. See document templates and mail merge documentation for more information about adding mail merge fields to standard documents. 


Once a customer clicks on the PayLink, they will be taken through the PayPal payment process. 


To insert a Standard Pay Link image:

  1. Use mail merge field { MERGEFIELD PayPalPay} and it will be replaced by the PayPal PayLink image. 



To insert a Custom Pay Link image:

  1. Use field with code { IF “{MERGEFIELD PayPalPayLink}”==”” “<CustomImage>” “<CustomImage>” } and this field will be replaced by PayLink with the specified <CustomImage>.






Payment Document Information

[back to top]


DEAR generates electronic documents (PDF, e-mail content) to enable your customers to seamlessly pay quotes and invoices. Payment documents can contain Pay Links, a link which takes customers through the DEAR Payment workflow. DEAR supports Stripe and Paypal as payment processors, and one payment document can contain links to both payment processors.




Types of payment documents

There are two types of payment documents:

  • Sale Quote document
  • Sale Invoice document


Sale Quote and Sale Invoice documents are generated from the Sale Quote and Sale Invoice document templates. You can see and edit the various template types by going to Settings -> Document and Email Templates



Sale Quote Payment Documents

A number of requirements should be met to enable Pay Links on generated Sale Quote documents:

  • Payment processor (Stripe or Paypal) should be configured
  • Sale Quote should be authorized
  • Pre-Payment account should be configured on account mapping page


Amount to pay for Sale Quote documents is calculated as the difference between the Sale Quote Total and all Payments/Prepayments.


After successfully completing the payment workflow, a Prepayment record is created with the Account defined on the Payment processor settings page.



Sale Invoice Payment Documents

A number of conditions should be met to enable “Pay Links” on generated Sale Invoice documents:

  •   Payment processor (Stripe or PayPal) should be configured

  •   Sale Invoice should be authorized


Amount to pay for Sale Invoice documents is calculated as the difference between the Sale Invoice Total and all Payments/Prepayments.


After successfully completing the payment workflow, a Payment record is created against the relevant invoice.