I have done a lot of work with PayPal's api over the years, and one of the biggest frustrations I had for a long time was that their ColdFusion support was limited. In the more recent versions of their API they have provided the ColdFusion development community with a CFC that interfaces with their Java API.
Then, when they dropped the requirement for a client-side .P12 certificate to be passed with each request as the only way to authenticate against their api, and added the option to use a signature string instead, they got close to a useful solution for the average CF developer.
The only thing that still causes many ColdFusion people to cringe and pull their hair out, is the fact that the PayPal.cfc returns a java object, which is something most CF developers don't deal with on a regular basis (if at all).
Fortunately for you, I have already taken the time to go through each of the API calls, and through the use of many cfdumps, I found every piece of information available in each of the responses, and then I put them into nice CF developer friendly ColdFusion structures.
When you invoke the API functions using my version of the PayPal.cfc file you will be able to do a single cfdump on the returnvariable and there you will see all the information returned by the API in one glance.
No longer will you have to things like this to get to get variables deep within the response object:
Now you will be able to access the same information like this:
Once you download the code, you will need to modify the PPInitialize function so that it uses your api signature and login credentials. There is also a cfm file that contains a sample of how to invoke each of the API functions.
Object Instantiation Exception.
An exception occurred when instantiating a Java object. The class must not be an interface or an abstract class. Error: ''.
The error occurred in D:Inetpublivewebsystemsshoppaypalpaypal.cfc: line 27
Called from D:Inetpublivewebsystemsshoppaypalpaypal.cfc: line 16
Called from D:Inetpublivewebsystemsshoppaypalpaypal.cfc: line 1
Called from D:Inetpublivewebsystemsshoppaypalindex.cfm: line 5
Called from D:Inetpublivewebsystemsshoppaypalpaypal.cfc: line 27
Called from D:Inetpublivewebsystemsshoppaypalpaypal.cfc: line 16
Called from D:Inetpublivewebsystemsshoppaypalpaypal.cfc: line 1
Called from D:Inetpublivewebsystemsshoppaypalindex.cfm: line 5
25 : <cfscript>
26 : // Create CF caller object
27 : pp_caller = CreateObject("java", "com.paypal.sdk.services.CallerServices");
28 :
29 : // Set API profile
1 -Install the PayPal Java SDK.
2 -Copy a subset of the Java SDK JAR files to a location accessible by the ColdFusion
application server. The JAR files are in SDK_rootlib and their exact names are as
follows:
bcmail-jdk14-128.jar
bcprov-jdk14-128.jar
paypal_base.jar
paypal_stubs.jar
sax2.jar
xerces.jar
xpp3-1.1.3.4d_b4_min.jar
xstream.jar-1.1.3.jar
3 -With the ColdFusion Application Server Administrator, add the absolute path of the
location you determined in Step 2 to the Java and JVM CLASSPATH environment variable.
4 -Restart the ColdFusion Application Server.
https://www.paypal.com/IntegrationCenter/ic_sdk-re...
Then download the Java SDK file for your operating system. If you are on windows you will download the zip file.
Does this need to be updated for the latest paypal SDK? I just installed the SDK and some of the jar files (bc* for example) are not in the /lib directory.
Also, what about recurring billing? Are you planning on adding them to the cfc?
Thanks,
Tim
Currently this CFC only handles the Direct Payment and the Express Checkout API calls. This worked with the paypal java sdk that you can download here:
https://www.paypal.com/IntegrationCenter/ic_sdk-re...
I have not worked it in several months, but I just downloaded the latest zip of the java sdk and it does look like the files are different. Whenever I have some free time I will look into what it will take to update my CFC.
I have been working on a really big Flex project lately, and haven't really had any free time for blogging, and I haven't done a paypal integration for a long time, so I'm not yet current with the new version of the SDK.
I have trouble to make it work. got error