in

dashCommerce

An ASP.NET Open Source e-Commerce Application

TransactionID not returned by PayPal

Last post 05-05-2009 10:27 PM by dotnetmamma. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 02-15-2008 5:42 AM

    TransactionID not returned by PayPal

    Hi

     I am using dash 3.0 Beta and PayPalPaymentsStandard in Sandbox mode.

    All works, I set up my order, am taken to paypal sandbox, I either pay by one of my test credit cards or by logging into my test account, make the payment and am taken to the paypal page where it confirms that payment has been made, invoice will be sent by email etc.  There is also an orange button that says, in essence, return to The Wonderful Test Store Setup Using Dash (or whatever I have called it). 

    If I click on this button I get an error that relates to the fact that the button click does not return the query string params expected by the dash file it targets:

    paypal/pdthandler.aspx

    Looking at the page_load handler for this page, the expected query string params are (in bold):

    ----------------------------------

    protected void Page_Load(object sender, EventArgs e) {

    //TODO: CMC - Add PDT Logging

    string transactionId = Request.QueryString["tx"];

    string orderId = Request.QueryString["cm"];

    // etc, etc

    }

     What am I doing wrong?  This happens with credit cards, verified accounts, unverified accounts...  I don't really have a handle on the problem.

    I note that this also happened to me with dashCommerce2.2, so it must by my problem, but I have no idea where to look.

  • 02-15-2008 8:39 AM In reply to

    Re: TransactionID not returned by PayPal

    Answer

    No one has replied, so I will give a status update on my progress:

     I am trying to use PayPal's PDT (Payment Data Transfer), or rather, my instance of dashComm is.

    For PDT to work, you need to:

    a.  login to your account (live or sandbox)

    a.1 Do not be fooled by logging into www.sandbox.paypal.com.  This shows you your Sandbox.  You cannot set your sandbox biz account profile from here.  Ie:

    The sandbox is made up of your personal accounts, that mimic your clients' accounts, ie the people buying your products, and your business account, that mimics your site's merchant account with paypal.  To continue with these recommendations, in your sandbox, go to Test accounts, then click the orange button at the bottom that says Enter Sandbox Test Site (or words to that effect).

    To continue with setting up PDT:

    b. go to MyAccount, then Click the Profile Sub tab (do not be deterred by the submenu that only gives a limited number of options). 

    c. You then choose Website Payment Preferences from the Selling Preferences link list.  You then proceed to do the following:

    c.1.  Set AutoReturn set to on. 

    c.2.  Supply AutoReturn with the url of the page that PayPal will return the data to. Ie, for a dashCommerce shopping cart: 

    www.yoursite.extension/paypal/pdthandler.aspx

    c.3.  Set Payment Data Transfer to ON.  For this to work, you MUST first complete setups c.1 and c.2!!!

    c.4.  Scroll to the bottom of the page and click Save.

    The above will set your live merchant account or your biz Sandbox account to effectively use PDT.  I will test now and post back.

    I just love talking to myself.  It is a way of documenting my progress.

     

  • 02-15-2008 10:48 AM In reply to

    Re: TransactionID not returned by PayPal

    Hi

    Problem solved.  The 1st reply describes the correct process. 

    I find paypal's documentation and sandboxes really difficult to work with until you have got your head round the jargon. 

    I hope this documents the problem someone else as thick as me...

  • 02-19-2008 4:14 AM In reply to

    Re: TransactionID not returned by PayPal

    As an addendum, for future reference, after fixing the problem as described above, I then fell into the following ape trap:

    On return to dashCommerce, after paying for a test transaction in PayPal's sandbox, ~/paypal/pdthandler.aspx did not redirect to ~/receipt.aspx

    The reason for this is that, when dash tries to synchronise with paypal, ie, confirm that the transaction has happened, the paypal webservice returns a FAIL Error 4020 message and does not redirect.

    I traced the 4020 paypal error message to being related to being caused by having the wrong PDT Identity Token (PayPal errors seem to be mostly very generic, so it is difficult to pinpoint the cause).  I then realised that I was using the PayPal API signature instead of the PDT Identity Token for the Sandbox merchant account.

    The following are the steps that lead me to fall into this Ape Trap:

    1.  Having tested with PayPal payments pro, the client decided they didn't want to pay a monthly sub, so I started to test the paypal payments standard provider.

    2.  I made the following *fairly reasonable* assumptions/steps:

    2.1. DashCommerce had connected to payments pro using the API signature.

    2.2.  So I just copied the signature and pasted it into the PayPalPaymentsStandard provider setting in the Admin Control Panel of DashComm.

    2.3  Being flustered and overworked, did not notice that the label of the textbox that I copied the signature into did NOT say API Signature, like it does for Pro provider, but rather:

    PDT ID.

    2.4. Not knowing, at that stage (read the above) what a PDT ID, it never crossed my mind to check what I was doing.

    2.5 I did wonder where the api password field had gone, and why it was not required, mind you...  So there is something Sapiens about me.

    2.6  By the time I had solved the above, I was whiting out every time I looked at the control panel config for paypal standard, and just wasn't seeing what I was looking at.

    3.  Anyway, it seems that PayPal Standard connects just using the email address and the PDT ID, which seems a bit of a security issue...?

    4.  The moral is:  RTFM.  Oh...  There isn't one.

  • 02-19-2008 4:31 AM In reply to

    Re: TransactionID not returned by PayPal

    I think that, if there is one thing that should be documented on DashCommerce, it is the way that PayPal is used by the system. 

    PayPal's documentation is typical of documentation that is trying to be all things to all comers.  It is also text intensive and jargon rich.  This makes understanding it a chicken and egg connundrum.  You have no hope of understanding it until you do.

    Add into the mix the sandbox and two things happen.  It becomes hard to tell what is what and you have to click through 10 pages just to get to where you can set the payment preferences for you sanbox merchant account.

    The reason for using dashCommerce is, appart from learning about asp.net best practices, to shortcut the problems with using PayPal APIs. 

    So hopefully, with this thread I have gone someway to proving useful info for anyone searching for:

    Sandbox, PayPal API, PDT ID, Payment data transfer, payment standard, etc.

    I also hope that I have coined a helpful new term applicable to software development, when using third party software, apis, libraries and frameworks:

    The notion of the Ape Trap. 

    This is sometimes called a gotcha, but this gives the wrong impression, ie, that someone is out to get you. 

    I feel ape trap is a richer term:  it conjures images of an irate ape, who has done nothing wrong other than follow his old, well trodden trail, but who ends up thrashing around in pit full of sharp objects and no bananas. 

    I think this more acurately describes this all too common phenomena.  It is also far more elucidating to the people/companies, ie, the aforementioned third parties, who develop software, apis, libraries and frameworks.  The term *gotcha* implies that the user who falls into the pit is just an unfortunate idiot who should make a career move, whereas Ape Trap implies a relatively intelligent being trying to use your tool to get his bananas and ending up skewered on bamboo spikes for his trouble.

    Ie, such a bad thing for the user is a VERY bad thing for you, all you software, api, library, framework, tool making @#~$%s!!

    Language is what makes us different, so let's use it to good effect.  The term gotcha is supercilious, arrogant, stupid, misguided and places the emphasis and the onus in the wrong place.

    So don't even get out of bed unless you are willing to adequately document what you do.

    I have spoken and will now hold my peace.

    From the deep, dark, pain flooded depths of the Ape Trap

    Your truly

    Huan Mard Aype Maan

  • 02-19-2008 10:27 AM In reply to

    Re: TransactionID not returned by PayPal

    If you would like to volunteer to help with the documentation, then please PM me.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us!
  • 02-19-2008 11:16 AM In reply to

    Re: TransactionID not returned by PayPal

    The sneer about not getting out of bed if you don't document what you do is not directed at you, but at PayPal.  Sorry, I realise now that it could be misconstrued.

    The quickest and most effective would be to:

    1.  Scrub the rubbish out my text in this thread and store it as a .pdf

    and / or

    2.  Record a couple of short camtasia videos:

    2.1 PayPal SandBox

    2.2 Using the PayPal SandBox to test the PayPal Standard Payment Provider

     Let me know if you want any or all or none.

    Once again, sorry if this was misconstrued.

  • 05-03-2008 10:50 AM In reply to

    Re: TransactionID not returned by PayPal

    It's been a while, just going thru some "Favorite" posts and I just want to say that if you write something up or do some videos I'll be happy to post them. No need to wait for me to say "yes" - if it is of value to you, then it will probably be of value to someone else.

    --
    Support dashCommerce - Buy Our Stuff!!


    Find a bug? Create a Work Item for a fast response.. Want to help? Create a patch for us! Documentation? Help us write some!
    Filed under:
  • 05-11-2008 1:49 PM In reply to

    • mejohnnyv
    • Top 50 Contributor
    • Joined on 04-13-2008
    • Maryville, TN
    • Posts 23

    Re: TransactionID not returned by PayPal

    thanks for talking to yourself, It really helped out tremdously. I hope you take Chris up on Docs or a video. Thank you again. Great help.

  • 03-11-2009 8:57 PM In reply to

    Re: TransactionID not returned by PayPal

     aewrigley

     

    How EXACTLY did you resolve this issue.  I have searched this site over and over and can't find the answer.  I am experiencing the same issue you have described, and I have provided details below in hopes that you can help me, and other out!

     

    I too am using PayPal Standard, to avoid the monthly $30 charge, and I have setup, not only a REAL business account, but also a SANDBOX version as well.  Currently I have my dashCommerce setup to use the Sandbox PDT ID, however, when PayPal attempts to redirect back to www.site.biz/paypal/pdthandler.aspx (as defined as the Return URL in Sandbox), I get an "Opps..." message from dashCommerce and the order never gets entered into dashCommerce (although the test buyer account gets charged).

     So from what I can tell, I have dashCommerce setup correctly with the Business Email and PDT ID, however, I can't get PayPal adn dashCommerce to synch the order and stop displaying that "Opps..." message.  When I review the error logs in dashCommerce it states the following:

     System.NullReferenceException: Object reference not set to an instance of an object.
       at MettleSystems.dashCommerce.Web.paypal.pdthandler.Page_Load(Object sender, EventArgs e) in C:\mettlesystems\code\open source\dashCommerce\Web\paypal\pdthandler.aspx.cs:line 93

    and this error is listed twice.  However before this error is logged, I do receive an INFO log that shows the following:

    Log Message:
    merchant_return_link=Return+to+Merchant

    but nothing displayed in the actual Log Info box.  ANy help you can shed on this would be greatly appreciated.  I have been racking my brain trying all sorts of stuff all day long and I can't help but get frustrated.  It's got to be somthing simple I'm over looking.  I came you because your posts have a lot in common with mine and you apparently have gotten your issue resolved.

    If there is any other details I can provide you, please let me know.  I anxiously await your response!

    Filed under:
  • 03-12-2009 10:45 AM In reply to

    Re: TransactionID not returned by PayPal

    Hi RScheck I have been developing an eLearning solution and updating a variety of sites (over 1000 pages), so slightly out of touch with dashCommerce. From reading your post, it does not seem that you have the same problem that I was having. This seems a different issue. However, the detail in your post does point to an issue I have had, intermittently, with dashCommerce that have not got round to looking into: 1. User checks out, goes to paypal, pays the amount due. PayPal generates the emails to the shop and to the client, but the order never gets registered in the dashCommerce database. 2. I assume that this may happen when the user does NOT return to your site from PayPal and instead, for example, closes his browser. 3. I have amended dashCommerce heavily, to include a donations page and I use a wizard control rather than the accordion job that dashCommerce uses. You can see this in action on shop.encephalitis.info (the Encephalitis Society being a charity that is very worth while supporting, not least because they pay me...). Please note that this site is due an overhaul, that we are working on at the following url: test.encephalitis.info. 4. As a result of 3., the problem described in 1. and 2. might be of my own making. So I need to sit down one day, switch the phone off and sort the bloody thing out. 5. I think I need to add a synchronizing feature that will poll paypal to see if certain orders have been paid. Or else get to the bottom of this problem. 6. I think that although I have never seen the errors you are seeing, they might point to a related issue. Sorry I can't help you. If you do solve this problem, please post back to this thread, as I will with any update. But I will not have any time within the next month. Good luck Andrew
  • 03-30-2009 4:38 PM In reply to

    Re: TransactionID not returned by PayPal

    All,

    I also am using standard and get exactly the same error(s) using the sandbox! I tried to change the ssl on/off but no effect. Has anybody made progress on this issue?? Can't go live until this is fixed.

    Joe

    Joe
    Filed under:
  • 05-05-2009 10:27 PM In reply to

    Re: TransactionID not returned by PayPal

     Has anybody figured out the problem described by RSCheck where they get the oops message when redirected back after making the payment with paypal standard?  I am having the exact same problem. 

     Thanks, 

    Laura

Page 1 of 1 (13 items)