PayPal Express is a legacy add-on that is still being supported but is no longer available for purchase. It will be sunset / removed by the end of 2024. If you are a current PayPal Express user, you have access to the new PayPal Checkout add-on at no additional cost; please contact us for details! If you are looking for a modern PayPal integration for Ninja Forms, please see the PayPal Checkout add-on. Documentation can be found here: PayPal Checkout documentation.
Migration to PayPal Checkout from PayPal Express
If you are a currently using the PayPal Express add-on for Ninja Forms and need to migrate to PayPal Checkout, please follow the below steps. If you are a new PayPal Checkout customer, you can safely disregard the steps below.
- Install/activate the PayPal Checkout add-on
- Go to Ninja Forms > PayPal Onboarding and complete onboarding
- One form at a time, open first PayPal form, add Checkout action, set it up, double check that any logic targeting old Express action is now targeting new Checkout action, disable PayPal Express action
- Test form in sandbox mode; after confirming it functions as expected, switch the form to ‘live’ mode to start accepting payments using the new PayPal Checkout
- Repeat steps 3 & 4 for each PayPal form
- Return to Ninja Forms > PayPal Onboarding and confirm that no forms are listed as still using PayPal Express
- Deactivate the PayPal Express add-on
If you need help at any stage, please contact us. We’re happy to assist!
The PayPal Expresss add-on needs to be installed and activated to see the features mentioned in this this documentation.
Note: Make sure your website meets PayPal security standards before use
PayPal has specific HTTPS and TLS security standards that your website must meet to be able to use their service to collect payments. If your website does not meet these security standards, you will not be able to communicate payment information to the PayPal service. Please see their documentation for details. If you have questions about your WordPress website meeting these standards, please contact your hosting provider.
Connecting Ninja Forms to PayPal
The first step to using PayPal with Ninja Forms is entering your API credentials for PayPal. This will allow your forms to communicate with PayPal and is a required first step before payments can be collected.
You will need both a PayPal Business account and a PayPal Sandbox Business account to get started.
Getting your Test/Sandbox API credentials
Test/Sandbox API credentials are used to test the functionality of your PayPal Express connection before rolling your form out live to your customers.
You can obtain your Test/Sandbox API credentials by logging into your PayPal Sandbox Business account and following PayPal’s documentation on requesting your Sandbox API signature.
- You need NVP/SOAP API integration (Classic) credentials
- You’re wanting an API signature, not certificate.
These credentials need to be entered under Ninja Forms > Settings > PayPal Express.
Getting your Live API credentials
Live API credentials are used to actually collect payments from your customers once your connection has been tested and confirmed to work.
You can obtain your Live API credentials by logging into your PayPal Business account and following PayPal’s documentation on requesting your Live API signature.
- You need NVP/SOAP API integration (Classic) credentials
- You’re wanting an API signature, not certificate.
These credentials need to be entered under Ninja Forms > Settings > PayPal Express.
You’re now ready to set up a form to collect payments. You’ll be able to switch back and forth between Test and Live credentials from each new form as desired.
PayPal Express Payment Template
The Product and Total fields have been deprecated since version 3.4.6 of the Ninja Forms core plugin https://wordpress.org/plugins/ninja-forms/#developers This was done due to them causing several bugs and not functioning with currencies that use a format different than the American format of commas and decimal points.
Going forward, you will need to set up a calculation instead. https://ninjaforms.com/docs/calculations/
Setting Up a Form to Collect Payments
Before setting up your form, be certain that you have set up your live API credentials as described in the section above.
First, open your payment form and click on the Emails and Actions tab at the top of the form builder.
Next, click the blue circle/+ icon in the bottom right of the screen to open the list of available actions.
Choose either the Collect Payment or PayPal Express action from the list of available actions. They’re functionally identical, so selecting either is fine.
With the action added to your form, click to open it. If you selected the Collect Payment action, you’ll need to set the PAYMENT GATEWAYS setting to PayPal Express. If you selected the PayPal Express action, this is already set for you.
You now need to set the total that will be sent to PayPal in the GET TOTAL FROM setting. This can be one of three options:
- A Fixed Amount
- A Calculation
- A Field
Charging a Fixed Amount
If the total sent to PayPal is a static amount that will never be different from purchase to purchase, select the Fixed Amount Option. Simply enter the amount you wish to charge in the ENTER AMOUNT setting.
When the form is submitted, users will be prompted to pay this fixed amount via PayPal.
Using a Calculation to generate a total
If you are charging variable amounts per purchase via a Ninja Forms calculation, that total can be sent to PayPal directly as the amount the user will be charged.
Simply select Calculation from the GET TOTAL FROM setting, and then select the calculation itself in the SELECT CALCULATION dropdown.
When the form is submitted, users will be prompted to pay the calculation’s value via PayPal.
Using a form field as the total sent to PayPal
If your purchase total is contained within a field such as a Number field, you can have the value of that field sent directly to PayPal.
Simply select the Field option from the GET TOTAL FROM setting, and then select the field that houses your total from the SELECT FIELD dropdown.
When the form is submitted, users will be prompted to pay the field’s value via PayPal.
Sending additional transaction data to PayPal, including notes for the buyer, and enabling sandbox testing mode
Under the Advanced settings of the Collect Payment/PayPal Express action, note the fields for Details and Note to Buyer.
Information entered into the Details section here will be saved as Transaction Data in PayPal. Use the merge tag icon to map in fields for shipping address, email, etc if desired.
Text entered into the Note to Buyer section will be displayed for the user in the PayPal checkout window when the form is submitted.
To enable testing for your form, toggle on the Sandbox Mode setting. With the appropriate sandbox API credentials entered as described in section one above, submitting the form in this mode will allow you to test the form with PayPal. This must be toggled off to accept live payments.
PayPal Express Merge Tags
{paypal_express:transaction_id}
This returns the Transaction ID from the PayPal payment. The data from this merge tag is not populated until after the payment is made.