Click here to Skip to main content
15,892,161 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How can we return deduct amount in same website by using Paypal Payflow pro account.


I am using Paypal Payflow pro account for one of my application. It does transaction but doesn't return deduct amount details. I am using first time Paypal Payflow account. So if anybody have done such kind of work before kindly share with me.
Posted
Updated 17-Oct-12 18:30pm
v2

1 solution

Hi to all i have done this, Kindly check my solution:



C#
protected NameValueCollection httpRequestVariables()
   {
       var post = Request.Form;       // $_POST
       var get = Request.QueryString; // $_GET
       return Merge(post, get);
   }


C#
 protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string output = "";
            if (httpRequestVariables()["RESULT"] != null)
            {
                HttpContext.Current.Session["payflowresponse"] = httpRequestVariables();
                output += "<script type=\"text/javascript\">window.top.location.href = \"" + url + "\";</script>";
                BodyContentDiv.InnerHtml = output;
                return;
            }

var payflowresponse = HttpContext.Current.Session["payflowresponse"] as NameValueCollection;
            if (payflowresponse != null)
            {
                HttpContext.Current.Session["payflowresponse"] = null;

                bool success = payflowresponse["RESULT"] == "0";
                if (success)
                {
                    output += "<span style="font-family:sans-serif;font-weight:bold;">Transaction approved! Thank you for your order.</span>";
                }
                else
                {
                    output += "<span style="font-family:sans-serif;">Transaction failed! Please try again with another payment method.</span>";
                }


C#
public string print_r(Object obj)
       {
           string output = "<pre>\n";
           if (obj is NameValueCollection)
           {
               NameValueCollection nvc = obj as NameValueCollection;

               output += "RESULT" + "=" + nvc["RESULT"] + "\n";
               output += "PNREF" + "=" + nvc["PNREF"] + "\n";
               output += "RESPMSG" + "=" + nvc["RESPMSG"] + "\n";
               output += "AUTHCODE" + "=" + nvc["AUTHCODE"] + "\n";
               output += "CVV2MATCH" + "=" + nvc["CVV2MATCH"] + "\n";
               output += "AMT" + "=" + nvc["AMT"] + "\n";

           }
           else
           {
               output += "UNKNOWN TYPE";
           }
           output += "";
       }
 
Share this answer
 
v5

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900