PayPal PayFlow Pro Environment Setup
Prerequisites
- Users must establish their own PayFlow Test Account. The following FAQ explains the steps to set one up: https://ppmts.custhelp.com/app/answers/detail/a_id/929/
- Users must also configure their account to send a Silent Post URL. Make sure you have the following set up in your PayPal Manager:
- Use Silent Post - Yes
- Enter Silent Post URL - (Public URL to send your transaction results to)
- CHECK - Void transaction when my server fails to receive data sent by the silent post.
** Note: To test PayFlow locally, you can use a service like https://ngrok.com/ to expose your application publicly so that the callback works.
Once you have established an account with PayPal PayFlow Pro,
begin by including the PayFlow Module dependency to your main pom.xml.
<dependency>
<groupId>com.broadleafcommerce</groupId>
<artifactId>broadleaf-paypal-payflowpro</artifactId>
<version>1.0.0-GA</version>
<type>jar</type>
<scope>compile</scope>
</dependency>
Make sure to include the dependency in your core
pom.xml as well:
<dependency>
<groupId>com.broadleafcommerce</groupId>
<artifactId>broadleaf-paypal-payflowpro</artifactId>
</dependency>
You should now begin to setup your environment to work with Broadleaf Commerce PayFlow support.
The first step is to make Broadleaf Commerce aware of your PayPal account credentials.
This is accomplished through environment configuration (see [[Runtime Environment Configuration]]).
Broadleaf allows you to create your own property files per environment (e.g. common.properties, local.properties, development.properties, integrationdev.properties, integrationqa.properties, staging.properties, and production.properties)
You will need to enter the following key/value pairs in the appropriate locations and replace the "?" with your paypal api account details:
You can also store these configs in the Database by utilizing the blSystemPropertiesService
. See the java docs for more details.
Properties File Config
- gateway.paypal.payflow.user=?
- gateway.paypal.payflow.password=?
- gateway.paypal.payflow.vendor=?
- gateway.paypal.payflow.partner=?
- gateway.paypal.payflow.hostAddress=pilot-payflowpro.paypal.com
- gateway.paypal.payflow.hostPort=443
- gateway.paypal.payflow.useTransparentRedirect=true
- gateway.paypal.payflow.usePayflowLinkHosted=false
- gateway.paypal.payflow.payflowLinkHostedAddress=https://pilot-payflowlink.paypal.com
- gateway.paypal.payflow.useRelativeUrls=false
- gateway.paypal.payflow.returnUrl=? (http://localhost:8080/paypal-payflow-pro/return)
- gateway.paypal.payflow.cancelUrl=? (http://localhost:8080/paypal-payflow-pro/cancel)
- gateway.paypal.payflow.errorUrl=? (http://localhost:8080/paypal-payflow-pro/error)
- gateway.paypal.payflow.silentPostUrl=? (http://xxxxx.ngrok.com/paypal-payflow-pro/silent)
- gateway.paypal.payflow.mode=TEST
- gateway.paypal.payflow.silentTrans=Y
Note - This module comes pre-configured with a Spring MVC controller with URL endpoints to handle:
Enable these with your component scan if you would like to use these in your implementation.
/paypal-payflow-pro/silent
/paypal-payflow-pro/return
/paypal-payflow-pro/cancel
/paypal-payflow-pro/error
Production Property Config
- gateway.paypal.payflow.hostAddress=payflowpro.paypal.com
- gateway.paypal.payflow.payflowLinkHostedAddress=https://payflowlink.paypal.com
- gateway.paypal.payflow.mode=LIVE
Other Important Production Considerations
If you need to update your firewall with the PayPal PayFlow IP addresses
https://ppmts.custhelp.com/app/answers/detail/a_id/883/related/1/session/L2F2LzEvdGltZS8xMzkyNjcxNzgzL3NpZC9lelFhWmFObA%3D%3D. Specifically:
URL: notify.paypal.com (Payflow Silent Post)
IP address: 173.0.81.65
Also, see the Going Live Checklist before going to production:
https://developer.paypal.com/webapps/developer/docs/classic/lifecycle/goingLive/
Also, note that you are unable to increase the default timeout of the SILENT POST
Data Transfer of 30 seconds (confirmed with PayFlow Technical support). This means that your entire Checkout Workflow must return a successful or unsuccessful response within that timeframe. If you have long running processes in your Checkout Workflow (e.g. other Third Party integrations) you may need to architect them in a way that they are called asynchrounously so as not to block the request back to PayPal.
Setting up your application
Now that you have your environment set up, let's begin setting up the [[PayPal PayFlow Module]].