in

dashCommerce

An ASP.NET Open Source e-Commerce Application

TransactionID not returned by PayPal

Last post 05-11-2008 1:49 PM by mejohnnyv. 8 replies.
Page 1 of 1 (9 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 25 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.

Page 1 of 1 (9 items)