In my last post we talked about PayPal purchasing Payflow Pro. In this post we will talk about how to integrate it into your current application. The first thing you need to do is sign up for a business account. To get started visit PayPal's getting started page.
Once you have signed up for account your ready to start coding. First sign in to your Payflow Pro manager and click on the downloads buttons in the upper right hand corner. Underneath the integration packages section you will see a ColdFusion Option. You have to accept some agreements and then you will be prompted to download CFX_PFPro_Java.zip. In the download there is a Users guide which has detailed installation instructions. I am going to go through the short installation procedure, for detailed instructions please use the guide.
First off we are going to go over a list of requirements. Please make sure you meet these requirements before moving forward.
- Web server running Macromedia ColdFusion v4.5, v5.x, MX v6.x, MX v7.x
- MX v6.x and x7.x users:
You must pass the proxy and parmlist variables along with the host address, host port,
and timeout value. If the PARMLIST and PROXY variables are not being used, then you
must still pass a NULL character for these variables. Example: PARMLIST=””,
- Sun’s Java JRE version 1.3.1_02 or higher. Available at http://java.sun.com/j2se/
- Before you can test this system, you must have registered for a VeriSign Payflow Pro
account at http://www.verisign.com/products-services/payment-processing/onlinepayment/
payflow-pro/index.html. The registration is free for testing purposes.
- Move both the Verisign.jar and CFXPayFlowPro.class files from the PFProColdFusion directory into a directory that is in your classpath.
/Verisign.jar to the end of the current class path. You can do this through the ColdFusion Administrator under JVM and Java Settings.
- Select the CFX Tags section of the ColdFusion administrator.
- Create a new Java tag:
Tag Name: CFX_PAYFLOWPRO
Class Name: CFXPayFlowPro
Note: The Class Name is case-sensitive and does not include the .class extension. The Tag
Name must be entered as shown above.
Stop and Restart your ColdFusion server service to initialize the changes. (Any time the
*.jar files are moved or changed, you must restart ColdFusion to initialize the changes).
- Copy the certs directory from the PFProColdFusion to a location of your choice. The certpath variable will be set in your calling code which we will get to in a minute.
- Time to run some code and do some testing.
Below is an example of how to implement the CFX_PayFlowPro tag.
HOSTPORT = "443"
TIMEOUT = "30"
PROXYADDRESS = ""
PROXYPORT = ""
PROXYLOGON = ""
PROXYPASSWORD = ""
TRXTYPE = "S"
TENDER = "C"
PARTNER = "PayPal"
USER = "PayPalLoginID"
PWD = "PayPalpassword"
ACCT = "5105105105105100"
EXPDATE = "1209"
AMT = "27.33"
COMMENT1 = "This is a comment - noautomatically escaped"
COMMENT2 = "Embedded = and & work when escaped"
CERTPATH = "C:\Inetpub\wwwroot\CFIDE\certs">
Here is the minimum list of attributes to pass when using the tag. Please stay tuned to further postings as I will discuss the full list of attributes.
- Query The name of the query result. Use the QUERY parameter after the transaction has been processed to identify this transaction
and get the results.
- HostAddress The HOSTADDRESS parameter specifies the VeriSign transaction server against which to
process. test-payflow.verisign.com is used for test transactions, and payflow.verisign.com is
used for live transactions.
HOSTADDRESS is a required field and should always have a value. If the value is left empty (“”),
then the tag gives an SSL error instead of a host address connection error.
- TRXTYPE A single character indicating the type of transaction to perform. Website Payments Pro Payflow Edition supports the following values:
S = Sale transaction
A = Authorization
C = Credit
D = Delayed Capture
V = Void
- Tender The tender type (method of payment). Values are:
@ C = Credit card for Direct Payment transactions
@ P = PayPal for Express Checkout transactions
- AMT The amount of the sale
- EXPDATE The expiration date of the credit card
- CERTPATH This is the fully qualified path of where the certs folder was copied to during step 6 of our installation process.
In conclusion I have a couple customers running this solution at the time of this post. Everything is running great so If you have any problems please send me an email and I will try and help you out.
NOTE: IF YOU ARE ALREADY USING THE VERISIGN SOLUTION THAN DO NOT BOTHER WITH THE INSTALLATION PROCESS, THE CURRENT FILES WILL WORK FOR BOTH VERISIGN AND PAYPAL. THE ONLY DIFFERENCE WILL BE THE PARTNER ATTRIBUTE PASSED THROUGH THE TAG.