Professional Web Applications Themes

Paypal Express Checkout - Coldfusion - Advanced Techniques

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 ...

  1. #1

    Default Paypal Express Checkout

    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(Un known Source)
    at com.paypal.sdk.core.APICallerFactory.createAPICall er(Unknown Source)
    at com.paypal.sdk.services.CallerServices.initialize( Unknown Source)
    at com.paypal.sdk.services.CallerServices.setAPIProfi le(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at
    sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)


    stephend Guest

  2. #2

    Default Re: Paypal Express Checkout

    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.



    aeye Guest

  3. #3

    Default Re: Paypal Express Checkout

    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.





    BKBK Guest

  4. #4

    Default Re: Paypal Express Checkout

    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.!!
    rorp Guest

  5. #5

    Default Re: Paypal Express Checkout

    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 DOENT.
    DOENT

    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 doentation 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.runFuncti on(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: DOENT
    at com.paypal.soap.api.PayPalAPISoapBindingStub._init OperationDesc1(Unknown
    Source)
    at com.paypal.soap.api.PayPalAPISoapBindingStub.<clin it>(Unknown Source)
    at com.paypal.soap.api.PayPalAPIInterfaceServiceLocat or.getPayPalAPI(Unknown
    Source)
    at com.paypal.soap.api.PayPalAPIInterfaceServiceLocat or.getPayPalAPI(Unknown
    Source)
    at com.paypal.soap.api.PayPalAPIInterfaceServiceLocat or.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.setAPIProfi le(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknow n Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Un known Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at coldfusion.runtime.java.JavaProxy.invoke(JavaProxy .java:74)
    at coldfusion.runtime.CfJspPage._invoke(CfJspPage.jav a:1634)
    at
    cfpaypal2ecfc2101376221$funcPPINITIALIZE.runFuncti on(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.invo ke(UDFMethod.java:294)
    at
    coldfusion.runtime.UDFMethod$ArgumentCollectionFil ter.invoke(UDFMethod.java:258)
    at coldfusion.filter.FunctionAccessFilter.invoke(Func tionAccessFilter.java:56)
    at coldfusion.runtime.UDFMethod.runFilterChain(UDFMet hod.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.resolveNam e(TemplateProxyFactory.java:33
    6)
    at
    coldfusion.runtime.TemplateProxyFactory.resolveNam e(TemplateProxyFactory.java:10
    2)
    at
    coldfusion.runtime.TemplateProxyFactory.resolveNam e(TemplateProxyFactory.java:96
    )
    at
    coldfusion.runtime.TemplateProxyFactory.resolveFil e(TemplateProxyFactory.java:74
    )
    at
    coldfusion.runtime.TemplateProxyFactory.resolveNam e(TemplateProxyFactory.java:62
    2)
    at coldfusion.tagext.lang.InvokeTag.doEndTag(InvokeTa g.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(Inclu deTag.java:349)
    at coldfusion.filter.CfincludeFilter.invoke(Cfinclude Filter.java:65)
    at coldfusion.filter.ApplicationFilter.invoke(Applica tionFilter.java:210)
    at coldfusion.filter.RequestMonitorFilter.invoke(Requ estMonitorFilter.java:51)
    at coldfusion.filter.PathFilter.invoke(PathFilter.jav a:86)
    at coldfusion.filter.LicenseFilter.invoke(LicenseFilt er.java:27)
    at coldfusion.filter.ExceptionFilter.invoke(Exception Filter.java:69)
    at coldfusion.filter.BrowserDebugFilter.invoke(Browse rDebugFilter.java:52)
    at
    coldfusion.filter.ClientScopePersistenceFilter.inv oke(ClientScopePersistenceFilt
    er.java:28)
    at coldfusion.filter.BrowserFilter.invoke(BrowserFilt er.java:38)
    at coldfusion.filter.GlobalsFilter.invoke(GlobalsFilt er.java:38)
    at coldfusion.filter.DatasourceFilter.invoke(Datasour ceFilter.java:22)
    at
    coldfusion.filter.RequestThrottleFilter.invoke(Req uestThrottleFilter.java:115)
    at coldfusion.CfmServlet.service(CfmServlet.java:107)
    at coldfusion.bootstrap.BootstrapServlet.service(Boot strapServlet.java:78)
    at jrun.servlet.ServletInvoker.invoke(ServletInvoker. java:91)
    at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvok erChain.java:42)
    at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequ estDispatcher.java:257)
    at jrun.servlet.ServletEngineService.dispatch(Servlet EngineService.java:541)
    at
    jrun.servlet.jrpp.JRunProxyService.invokeRunnable( JRunProxyService.java:204)
    at
    jrunx.scheduler.ThreadPool$DownstreamMetrics.invok eRunnable(ThreadPool.java:318)
    at
    jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRu nnable(ThreadPool.java:426)
    at
    jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeR unnable(ThreadPool.java:264)
    at jrunx.scheduler.WorkerThread.run(WorkerThread.java :66)


    MAXXDOGG Guest

  6. #6

    Default Re: Paypal Express Checkout

    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.


    BKBK Guest

  7. #7

    Default Re: Paypal Express Checkout

    I received the same message.


    rece123 Guest

  8. #8

    Default Re: Paypal Express Checkout

    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 Guest

  9. #9

    Default Re: Paypal Express Checkout

    I have implemented these new jars on my system and it is now working properly!
    Thank You Patrick and PayPal Support!

    MAXXDOGG Guest

  10. #10

    Default Re: Paypal Express Checkout

    >... I have implemented these new jars on my system and it is now working 
    Aha, you see! Nothing beats a happy ending.

    BKBK Guest

  11. #11

    Default Re: Paypal Express Checkout

    How could I obtain response from paypal?

    Paypal Payments Pro work for ColdFusion 5?
    rece123 Guest

  12. #12

    Default Re: Paypal Express Checkout

    Hi Guys,

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

    co.uk

    Thanks

    Sana
    sanaullah Guest

  13. #13

    Default Re: Paypal Express Checkout

    Hi

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

    thank you.
    stephend Guest

  14. #14

    Default Re: Paypal Express Checkout

    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

    sanaullah Guest

  15. #15

    Default Re: Paypal Express Checkout

    Hi,

    Thank you for the your help.
    stephend Guest

  16. #16

    Default Re: Paypal Express Checkout

    You would become my hero for the day if you could send it
    TheCoolLion Guest

  17. #17

    Default Re: Paypal Express Checkout

    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
    sanaullah Guest

Similar Threads

  1. Form entries to paypal checkout
    By yeshuaway in forum Macromedia Exchange Dreamweaver Extensions
    Replies: 2
    Last Post: March 25th, 04:32 PM
  2. can you please checkout these urls
    By j2eesatish in forum Macromedia Flex General Discussion
    Replies: 1
    Last Post: August 3rd, 07:37 PM
  3. What point did they checkout?
    By barbedwire103 in forum Dreamweaver AppDev
    Replies: 0
    Last Post: April 27th, 09:34 PM
  4. Checkout Problems
    By Frustrated in Philly in forum Macromedia ColdFusion
    Replies: 1
    Last Post: March 16th, 09:22 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139