PayPal IPN API Change?

Word Count: 312

Trying saying that title 5 times fast! I have a customer that uses the PayPal IPN (Instant Payment Notification) service. The way the service works is pretty basic. A users places products in a cart on your site, when they are ready to place an order they are transfered to PayPal to place the order. When the order is complete you are transfered back to your shopping cart. So far so simple right? Up until about 2 weeks ago I would say yes.

The code on the site has been working great for the past 3 years and really no complaints from the customer. All of a sudden I have been seeing many errors come through telling me that form.fieldnames is undefined. This is how they used to pass transaction parameters back, through a form structure. Without any warning or announcement (at least that I am aware of) the service no longer passes back a form structure, everything is sent through the URL. I am just amazed that they would change the service like this. I know have to go through and change the code for the client.

Is anyone else having this problem or are they playing a joke on me? If this was public knowledge & no I did not get the memo (Peter)(office space) than I apologize. I am pretty deep in the programming community and have to believe that I would have found out about this If an announcement was made. Ok rant over, please leave a comment If you are having this problem or If I was the one to notify you of it!


Payflow Pro Made Easy

Word Count: 344

If you have ever had to do credit card processing you most likely have come across this problem in the past. Payflow Pro is a popular gateway that you may have used back in the day and was previously owned by Verisign. Times have changed and now Paypal owns the software but what we are going to discuss should work for both. In the past (at least to my knowledge) you had to install the cfx_payflowpro tag on your ColdFusion server which ended up being a big pain, especially if you did not have rights to the server.

Today I am happy to announce that I have solved that problem. Credit card processing using Paypal's PayflowPro just got a lot easier. The reason for this is mainly due to Mark Mandel's Java Loader which is a library that handles creation of Java objects from external Java libraries. So how does it work? I have created a component using JavaLoader that will load the java class files and basically wraps the Java methods. This is great because now you can process credit cards without installing anything on the server.

The code is not quite ready to be released yet but I thought I would share a little code snippet. Imagine at the end of your checkout process you could provide real time processing with as little code as shown below.

<!--- create an instance of our PayflowPro component --->
   <cfset payflowpro = createObject("component","PayflowPro").init("C:\Program Files\Apache Group\Apache2\htdocs\paypal\Verisign.jar")>
   <!--- set the certificate path --->
   <cfset payflowpro.setCertPath("C:\Program Files\Apache Group\Apache2\htdocs\paypal\certs")>
   <!--- setup the context --->
   <cfset payflowpro.createContext("test-payflow.verisign.com",443,30)>   
   <!--- the param list --->
   <cfset payflowpro.setParamList(user,vendor,partner,pwd,trxtype,tender,acct,expdate,accttype,amt,currency,cvv2,street,city,state,country,zip,firstname,lastname,clientip,comment1,comment2,custref,invnum)>
   <!--- submit the transaction, returns a string --->
   <cfset response = payflowpro.submitTransaction()>
   <!--- destroy the context --->
   <cfset payflowpro.destroyContext()>

I am really looking for people who are looking to do processing with PayflowPro so I could get others thoughts on the library and how to use it. Any comments or questions are welcome so please feel free to leave them.

Payflow Pro - A Simple Problem & Solution

Word Count: 148

I am going to continue on my Payflow Pro run here and share a simple problem and solution that a client recently presented me with. The customer uses the Payflow Pro manager to view the transaction list. The only problem is that the order id on our end is passed to the gateway but it is in a comments section and the only way to view the comments is to view the details. You can see from the image above that shows a listing of transactions that it is very hard to easily match up an order from our end to a transaction on their end. I found a simple fix to this, simply pass the first and last name attributes in the calling tag. This will make the list view of transactions easy to drill down to find a specific transaction.

<CFX_PAYFLOWPRO
   QUERY = "RESULT"
   HOSTADDRESS = "payflow.verisign.com"
   HOSTPORT = "443"
   TIMEOUT = "30"
   PROXYADDRESS = ""
   PROXYPORT = ""
   PROXYLOGON = ""
   PROXYPASSWORD = ""
   TRXTYPE = "S"
   TENDER = "C"
   certpath = "#certpath#"
   PARTNER = "paypal"
   USER = "username"
   PWD = "password"
   ACCT = "#acct#"
   EXPDATE = "#expdate#"
   AMT = "#amt#"
   COMMENT1 = "Order Number is #order_num#"
   COMMENT2 = ""
   CURRENCY = "AUD"
   FIRSTNAME = "#firstname#"
   LASTNAME = "#lastname#">

Getting Started With PayPal's Payflow Pro Part II

Word Count: 454

I just realized that in my last post I did not explain what to do after you make the call using the Payflow Pro tag. The query attribute in the tag is the variable you will use to parse out the result. The query variable will return a query with the following values.

  • #Queryname.resultstr# gives the full, exact response from the server. For example, if you passed QUERY = “Transaction” to the ColdFusion CFX_PayFlowPro tag, then you could refer to the data as #Transaction.resultstr# in your ColdFusion script.
  • #Queryname.resultstr# includes name/value pairs that can be referenced by name. For example, if #Transaction.resultstr# returned RESULT=0&RESPMSG=Approved&PNREF=V6000000, then you could reference the name value pairs using #Transaction.result#, #Transaction.respmsg#, and #Transaction.pnref# respectively.
Additional name/value pairs that are not contained within the resultstr include:
  • #Queryname.parmlist# Returns the entire string passed to the server in the attempt to process a transaction.
  • #Queryname.version# Returns the version of the SDK used to process the transaction. This is useful when requesting support from PayPal.
Any logic to interpret results can use standard ColdFusion functions. To fully understand the transaction process, see Payflow Pro Developer’s Guide.

Below is an example of how I parse out the result to email myself based on the result.

<cfoutput query="result">
<cfif respmsg eq "approved">
   <!--- approved --->
   <!--- Your order was approved. --->
   <cfmail to="#toemail#" from="#fromemail#" subject="Order Approved." type="HTML">
      <strong>Auth Code:</strong> <br>
      <strong>PNREF:</strong>    #pnref#<br>
      <strong>RESPMSG:</strong> #respmsg#<br>
      <strong>Result:</strong>   #result#<br>
      <strong>Version:</strong> #version#<br>
      <strong>ParamList:</strong> #parmlist#<br>
      <strong>ResultStr:</strong> #resultstr#<br>
      <hr/>
   </cfmail>
<cfelse>
   <cfset commit = false>
   <!--- denied, the message will be diplayed on the checkout page --->
   <cfmail to="#toemail#" from="#fromemail#" subject="Order declined." type="HTML">   
      <strong>RESPMSG:</strong> #respmsg#<br>
      <strong>Result:</strong>   #result#<br>
      <strong>Version:</strong> #version#<br>
      <strong>ParamList:</strong> #parmlist#<br>
      <strong>ResultStr:</strong> #resultstr#<br>
      <hr/>   
      <cfloop list="#parmlist#" delimiters="&" index="key">
         #key#<br>
      </cfloop>
   </cfmail>
</cfif>
</cfoutput>

Payflow Pro Supported Currency

Word Count: 102

I just thought I would let everyone out there know that you can Payflow Pro supports multiple currencies.
Website Payments Pro Payflow Edition supports the following currencies:

  • USD (US dollar)
  • EUR (Euro)
  • GBP (UK pound)
  • CAD (Canadian dollar)
  • JPY (Japanese Yen)
  • AUD (Australian dollar)
Unlike other processors that require you to set up a separate account for each currency, PayPal allows you to run transactions using any of the six currencies with a single account.

Getting Started With PayPal's Payflow Pro

Word Count: 945

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.

Requirements
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="", PROXYADDRESS=""
  • 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.

Installation

  1. Move both the Verisign.jar and CFXPayFlowPro.class files from the PFProColdFusion directory into a directory that is in your classpath.
  2. Add /Verisign.jar to the end of the current class path. You can do this through the ColdFusion Administrator under JVM and Java Settings.
  3. Select the CFX Tags section of the ColdFusion administrator.
  4. Create a new Java tag:
    Tag Name: CFX_PAYFLOWPRO
    Class Name: CFXPayFlowPro
    Description: CFXPayFlowPro
    Note: The Class Name is case-sensitive and does not include the .class extension. The Tag Name must be entered as shown above.
  5. 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).
  6. 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.
  7. Time to run some code and do some testing.

The Code
Below is an example of how to implement the CFX_PayFlowPro tag.

<CFX_PAYFLOWPRO
   QUERY = "RESULT"
   HOSTADDRESS    ="test-payflow.verisign.com"
   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">

Attribute List
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
  • ACCT
  • 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.

PayPal Purchases Payflow Pro

Word Count: 453

First off I am not sure when this took affect but it is on their website so I assume it is public knowledge by now. If you have ever looked into accepting payments online than you have probably either heard of or implemented Payflow Pro. The Payflow Pro gateway was owned and operated by Verisign. PayPal had a system similar to this called Website Payments pro that would give you the ability to integrate real time processing using your PayPal business account. I am not sure what the final reason to abandon that product was but I can tell you that many developers, including myself were having major issues with integration of it.

Ok, so now that Website Payments Pro is out of the picture and Payflow Pro is in what is it and what can we expect. For starters Payflow Pro is a proven gateway and has been around a while so ease of use and stability are defiantly it’s strong points. So what will does this mean to you, well it will let you do the following.

  • Accept credit cards, debit cards, more. Plus accept PayPal too (U.S.only).
  • Optimize the customer experience by letting shoppers complete the checkout process without leaving your website.
  • Stay secure with access to one of the most powerful risk-management systems.

One of my favorite features of this gateway is it's easy integration. This has to be one of the easiest gateway's out there that seamlessly integrates into a new or existing application. Another great feature and new is the ability to use PayPal as the merchant (duh!). The only requirement is that you need to have a business account which is fairly easy to setup or upgrade your existing account to. If you end up going with PayPal as the merchant then they will wave the $250 setup fee that comes with the product.

Below are some links to help get you started with PayPal's Payflow Pro. I will also be writing a quick integration how to next so be on the look out for that. Also if anyone has anything I should add to this post please let me know, I wrote this very quickly!.

Payflow Pro: Online Payment Gateway
Payflow Gateway Pricing

Copyright © 2007 Dan Vega | BlogCFC was created by Raymond Camden. This blog is running version 5.8.001.