简体   繁体   English

我们如何使用Paypal Payflow专业版帐户在同一网站上返还金额

[英]How can we return amount in same website by using Paypal Payflow pro account

How can we return deduct amount in same website by using Paypal Payflow pro account? 如何使用Paypal Payflow专业版帐户在同一网站上退还扣除额?

I am using Paypal Payflow pro account for one of my application. 我正在为我的应用程序之一使用Paypal Payflow专业帐户。 It does transaction but doesn't return deduct amount detail. 它进行交易,但不返回扣除金额明细。 I am using first time Paypal Payflow account. 我正在使用首次Paypal Payflow帐户。 So if anybody have done such kind of work before kindly share with me. 因此,如果有人在与我分享之前做过这样的工作。

Hi i have done this, Anybody who needs solution see below: 嗨,我已经做到了,任何需要解决方案的人请参见以下内容:

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

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>";
                }


                output += "<p>(server response follows)</p>\n";
                output += print_r(payflowresponse);

                AdvancedDemoContent.InnerHtml = output;


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 += "</pre>";
        return output;
    }

转到您的PayPal商家帐户->配置文件->销售首选项->网站付款首选项->“网站付款自动返回”打开单选按钮,默认情况下它应该关闭。交易后,请确保该值存储在您的我希望这对您有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM