Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / ColdFusion / Advanced Techniques / October 2005



Tip: Looking for answers? Try searching our database.

Paypal Express Checkout

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
stephend - 07 Aug 2005 07:19 GMT
Hi
I have been trying to get paypals new express checkout working with
Coldfusion, I have tried several aproaches eg.
Java CFX , and inline java code both with the same result. The CFX aproach
worked when running the code in debug mode but always failed when run in
coldfusion, I am using the same classpath in both the debug mode and via
Coldfusion.

I have an example of some code which I was tryng using the inline method,
which generated the same error as the cfx method I have also included the error
messages from the log file.

It always fails on this call "caller.setAPIProfile(profile);"

The code is based on the example that comes with the Java sdk from paypal.
I was hoping some could perhaps give a clue where to look for try and resolve
the error, or that someone may have already solved this problem.
Any other methods using the paypal express checkout would also be appreciated.

Thank you for any help.

<cfscript>
function TestPaypal() {

var caller=CreateObject("java", "com.paypal.sdk.services.CallerServices");

var test=CreateObject("java", "com.paypal.sdk.profiles.ProfileFactory");
    profile = test.createAPIProfile();
    profile.setAPIPassword("12345678");
    profile.setAPIUsername("sdk-seller_api1.sdk.com");

    profile.setCertificateFile("/opt/coldfusionmx7/cfx/java/distrib/examples/Cert/s
dk-seller.p12");
                     profile.setPrivateKeyPassword("password");
                     profile.setEnvironment("sandbox");
   
                     caller.setAPIProfile(profile);
   
}

TestPaypal();
</cfscript>

ERROR MESSAGE

java.lang.NoClassDefFoundError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at com.paypal.sdk.core.APICallerFactory.loadCaller(Unknown Source)
        at com.paypal.sdk.core.APICallerFactory.createAPICaller(Unknown Source)
        at com.paypal.sdk.services.CallerServices.initialize(Unknown Source)
        at com.paypal.sdk.services.CallerServices.setAPIProfile(Unknown Source)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
aeye - 19 Aug 2005 17:56 GMT
Have you found a solution to this yet?  We've been seeing the exact same
problem.  

We've also tried creating a Java class to execute the same functionality with
no luck.  

The same issue will come up with Direct Payment as well if you are
implementing Website Payments Pro.
stephend - 20 Aug 2005 01:41 GMT
Hi,

I have been trying to get the java code from paypal to work with coldfusion,
it works on it's own ok and I have made some progress, but it's been slow as I
am learning java as I go, it seems to fall in a heap once it starts trying to
call the web service in the java code or around that area anyway.

All the code to setup the profile seems to work ok.

When / if I get it working I will indicate how on this list.

It has become a bit of a background task at this time.
BKBK - 20 Aug 2005 10:39 GMT
Have you tried taking the constructor(s) into account?
That is, using

caller.init().setAPIProfile(profile);

or

caller.init(arg1, arg2,...).setAPIProfile(profile);

instead of caller.setAPIProfile(profile);? Just a thought.
rorp - 07 Sep 2005 15:24 GMT
I am also having the same problem... I have tried using the init() with same results. Hpe someone can find a solution or a way around it soon.!!
MAXXDOGG - 09 Oct 2005 03:38 GMT
I get the error below. I believe it is the same error everyone else is seeing.
I think it is a jar version error...perhaps with axis?
Any solution to this?

------------------------ERROR MESSAGE ---------------------------------
 Could not access a java object field called DOCUMENT.
DOCUMENT
 
The error occurred in C:\Inetpub\wwwroot\PayPal\paypal.cfc: line 30
Called from C:\Inetpub\wwwroot\PayPal\paypal.cfc: line 2
Called from C:\Inetpub\wwwroot\PayPal\TransactionSearchResults.cfm: line 7

28 :             pp_profile.setPrivateKeyPassword("password");
29 :             pp_profile.setEnvironment("sandbox");   
30 :             pp_caller.setAPIProfile(pp_profile);
31 :         </cfscript>
32 :     </cffunction>

Resources:

    * Check the ColdFusion documentation to verify that you are using the
correct syntax.
    * Search the Knowledge Base to find a solution to your problem.

Browser       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12)
Gecko/20050915 Firefox/1.0.7
Remote Address       127.0.0.1
Referrer       http://localhost/paypal/TransactionSearch.cfm
Date/Time       08-Oct-05 07:31 PM
Stack Trace
at
cfpaypal2ecfc2101376221$funcPPINITIALIZE.runFunction(C:\Inetpub\wwwroot\PayPal\p
aypal.cfc:30) at
cfpaypal2ecfc2101376221.runPage(C:\Inetpub\wwwroot\PayPal\paypal.cfc:2) at
cfTransactionSearchResults2ecfm278944404.runPage(C:\Inetpub\wwwroot\PayPal\Trans
actionSearchResults.cfm:7)

java.lang.NoSuchFieldError: DOCUMENT
    at com.paypal.soap.api.PayPalAPISoapBindingStub._initOperationDesc1(Unknown
Source)
    at com.paypal.soap.api.PayPalAPISoapBindingStub.<clinit>(Unknown Source)
    at com.paypal.soap.api.PayPalAPIInterfaceServiceLocator.getPayPalAPI(Unknown
Source)
    at com.paypal.soap.api.PayPalAPIInterfaceServiceLocator.getPayPalAPI(Unknown
Source)
    at com.paypal.soap.api.PayPalAPIInterfaceServiceLocator.getPort(Unknown
Source)
    at com.paypal.sdk.core.AxisAPICaller.setupConnection(Unknown Source)
    at com.paypal.sdk.core.APICaller.setProfile(Unknown Source)
    at com.paypal.sdk.services.CallerServices.setAPIProfile(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy.java:74)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.java:1634)
    at
cfpaypal2ecfc2101376221$funcPPINITIALIZE.runFunction(C:\Inetpub\wwwroot\PayPal\p
aypal.cfc:30)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:348)
    at coldfusion.filter.SilentFilter.invoke(SilentFilter.java:47)
    at coldfusion.runtime.UDFMethod$ReturnTypeFilter.invoke(UDFMethod.java:294)
    at
coldfusion.runtime.UDFMethod$ArgumentCollectionFilter.invoke(UDFMethod.java:258)
    at coldfusion.filter.FunctionAccessFilter.invoke(FunctionAccessFilter.java:56)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMethod.java:211)
    at coldfusion.runtime.UDFMethod.invoke(UDFMethod.java:173)
    at coldfusion.runtime.CfJspPage._invokeUDF(CfJspPage.java:1807)
    at cfpaypal2ecfc2101376221.runPage(C:\Inetpub\wwwroot\PayPal\paypal.cfc:2)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at
coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:33
6)
    at
coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:10
2)
    at
coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:96
)
    at
coldfusion.runtime.TemplateProxyFactory.resolveFile(TemplateProxyFactory.java:74
)
    at
coldfusion.runtime.TemplateProxyFactory.resolveName(TemplateProxyFactory.java:62
2)
    at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTag.java:341)
    at
cfTransactionSearchResults2ecfm278944404.runPage(C:\Inetpub\wwwroot\PayPal\Trans
actionSearchResults.cfm:7)
    at coldfusion.runtime.CfJspPage.invoke(CfJspPage.java:152)
    at coldfusion.tagext.lang.IncludeTag.doStartTag(IncludeTag.java:349)
    at coldfusion.filter.CfincludeFilter.invoke(CfincludeFilter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(ApplicationFilter.java:210)
    at coldfusion.filter.RequestMonitorFilter.invoke(RequestMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.java:86)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilter.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(ExceptionFilter.java:69)
    at coldfusion.filter.BrowserDebugFilter.invoke(BrowserDebugFilter.java:52)
    at
coldfusion.filter.ClientScopePersistenceFilter.invoke(ClientScopePersistenceFilt
er.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilter.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilter.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(DatasourceFilter.java:22)
    at
coldfusion.filter.RequestThrottleFilter.invoke(RequestThrottleFilter.java:115)
    at coldfusion.CfmServlet.service(CfmServlet.java:107)
    at coldfusion.bootstrap.BootstrapServlet.service(BootstrapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:541)
    at
jrun.servlet.jrpp.JRunProxyService.invokeRunnable(JRunProxyService.java:204)
    at
jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:318)
    at
jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:426)
    at
jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
rece123 - 13 Oct 2005 16:05 GMT
I received the same message.
rece123 - 20 Oct 2005 13:20 GMT
How could I obtain response from paypal?

Paypal Payments Pro work for ColdFusion 5?
BKBK - 09 Oct 2005 10:37 GMT
It's interesting that the code you all seem to be having trouble with has to
with authentication, hence with security. What happens when you extend the
"permissions" of your account on directories concerned? For example, give
yourself write permission if you hadn't before.
sanaullah - 21 Oct 2005 12:51 GMT
Hi Guys,

There is probelm with jar files, If anybody interested i can send full working sample , with updated jar files and code.

sana@sanaullah.co.uk

Thanks

Sana
stephend - 21 Oct 2005 13:31 GMT
Hi

I would be greatfull for a working version if you are  happy to give it out.

thank you.
sanaullah - 27 Oct 2005 23:22 GMT
I hope you know already about PayPal API for direct payment system or at least
you have spent some time how this works.
If you are interested in PayPal Direct Payment System for your site. PayPal
API does direct payment transaction from your server to PayPal. Direct Payment
systems have two methods
(1) Authorisation (2) sale.
The API does REAL time transaction and your buyers will have instantly
decision from PayPal transaction without leaving your site.
If your CFMX7 installation is Multi Instance then copy all jar files directly
into ColdFusion lib path
For example
C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\WEB-INF\cfusion\lib
If CFMX7 installation is standard edition then please flow the below
instructions.
1. Create a C:\paypal\lib\ directory.
2. From the <SDK ROOT>\lib directory, copy the following files to the
C:\paypal\lib\ directory:
(Note: <SDK ROOT> is the directory where you installed the PayPal SDK)
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
3. In the ColdFusion Administrator, add the C:\paypal\lib path to the
ColdFusion Class Path (Java and JVM).
4. Restart the ColdFusion MX service.
5. Move all files from the <SDK_ROOT>\ColdFusion directory to your CFMX7
project directory webroot.
Download sample code and try. Other things details are inside README.TXT file,
how to create your own P12 certificate file and your PayPal ACCESS API
instructions.

http://www.sanaullah.co.uk/paypal.zip
stephend - 27 Oct 2005 23:35 GMT
Hi,

Thank you for the your help.
TheCoolLion - 28 Oct 2005 07:45 GMT
You would become my hero for the day if you could send it
sanaullah - 29 Oct 2005 02:27 GMT
Hi  TheCoolLion
What type of help your are looking now.
Dowload CODE and test, all instructions are inside and I have explained in forum as well.

http://www.sanaullah.co.uk/paypal.zip

Thanks
MAXXDOGG - 17 Oct 2005 22:34 GMT
Here is my response from the PayPal tech support regarding this issue.
(BTW...PayPal support is very prompt and professional)...

Tony,
I've learned this issue is due to a bug in the the old SDK. We have updated
jar files that will work to fix this. Please note that these updated jars are
beta however an updated SDK that uses these jars is in the works. Check
www.paypal.com/sdk from time to time and you will want to grab v3.0 when it
becomes available. For now, you can go to www.paypaltech.com/sdk/jars.zip and
download the updated paypal_base and paypal_stubs.jar. Replace the old versions
in your SDK lib folder with the updated versions, restart ColdFusion and you
should see the correct result.
Let me know if this does not work for you.
Patrick
PayPal Merchant Technical Support
PayPal, an eBay Company

Hope this solves some problems. Can anyone confirm this...I'm having trouble
opening that zip file.

Thanks,

Tony
MAXXDOGG - 17 Oct 2005 23:48 GMT
I have implemented these new jars on my system and it is now working properly!
Thank You Patrick and PayPal Support!
BKBK - 18 Oct 2005 20:44 GMT
>... I have implemented these new jars on my system and it is now working
>... properly! Thank You Patrick and PayPal Support!
Aha, you see! Nothing beats a happy ending.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.