Paypal Issue

Last post 11-15-2007 5:31 AM by kvk543. 2 replies.

Sort Posts:

  • Paypal Issue

    03-05-2007, 2:50 PM
    • Loading...
    • kgooding
    • Joined on 03-05-2007, 7:41 PM
    • Laguna Niguel
    • Posts 7

    Hi All,

     

    I am sorry I have to make my first repost as a request, but I am in desperate measures. I just converted my shopping cart with AJAX, and it works perfectly, except the checkout button. I know I cannot use Response.Write within an AJAX application, but could someone tell me how I would bypass if I use:

      

    byte[]data=Encoding.ASCII.GetBytes(postData);
    
    HttpWebRequestppRequest=(HttpWebRequest)WebRequest.Create("https://www.paypal.com/cgi-bin/webscr");;
    ppRequest.Method="POST";
    ppRequest.ContentType="application/x-www-form-urlencoded";
    ppRequest.ContentLength=data.Length;
    
    //Send
    StreamppStream=ppRequest.GetRequestStream();
    ppStream.Write(data,0,data.Length);
    ppStream.Close();
    
    //Receive:¬(
    HttpWebResponseppResponse=(HttpWebResponse)ppRequest.GetResponse();
    StreamReadersr=newStreamReader(ppResponse.GetResponseStream());
    stringstrResult=sr.ReadToEnd();
    sr.Close();
    
    //Writetoscreen
    
    Response.Clear();
    Response.Write(strResult);
    Response.End();
     

    The button that raises this event is within the updatepanel, and it simple writes out the paypal checkout form on the page. I would love to get this going as it has been so simple so far. I have tried the ScriptManager class but no luck here, as I want to literry redirect with my PostDta.

     

    So if anyone can offer an alternative that would be much appreciate, and if anyone wants sample code I am more than happy to share.

     

    Thanks,

     

    Kurt 

  • Re: Paypal Issue

    03-05-2007, 7:47 PM
    • Loading...
    • kgooding
    • Joined on 03-05-2007, 7:41 PM
    • Laguna Niguel
    • Posts 7

    Sorry, I was being stupid!

     

    Simply using the ScriptManager I redericted to a page where paypal.aspx which has the follwoing in the code-behind:

     

    Response.Clear();
    Response.Write(Session["userCart"]);
    Response.End();

     

    And on the stated page I put strResult into a session object.

  • Re: Paypal Issue

    11-15-2007, 5:31 AM
    • Loading...
    • kvk543
    • Joined on 11-06-2007, 11:06 PM
    • Posts 15

    Hi all,

    i am working with paypal for money transaction

    i am sending the amount details , return url etc to the paypal after transaction   it is coming to my site i am showing the approved or declined details so far is ok.

    at the last page of paypal site that shows u the "RETURN TO MERCHANT"  in that page view source there is details of transaction   i want to get the               "transaction id "  which is in hiidden   like txn_id  

    i want to get the transaction id    can any one help me out

    using express checkout,doexpresscheckout ,pdt,inv we can do this

    but i tried hard    no use

    can any one clearly give details how to do this

     

    thanx in advance

    vijay

Page 1 of 1 (3 items)