【问题标题】:How can we return amount in same website by using Paypal Payflow pro account我们如何使用 Paypal Payflow 专业帐户在同一网站返回金额
【发布时间】:2012-10-08 11:14:58
【问题描述】:

我们如何使用Paypal Payflow pro帐户在同一网站返回扣除金额?

我正在为我的一个应用程序使用 Paypal Payflow 专业帐户。它进行交易但不返回扣除金额的详细信息。我第一次使用 Paypal Payflow 帐户。所以如果有人之前做过这样的工作,请与我分享。

【问题讨论】:

    标签: asp.net paypal


    【解决方案1】:

    您好,我已经这样做了,任何需要解决方案的人请参见下文:

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

    【讨论】:

      【解决方案2】:

      转到您的 PayPal 商家帐户-->个人资料-->销售偏好-->网站支付偏好-->网站支付的自动退货将单选按钮打开,默认应该关闭。交易后确保该值是存储在您的数据库中。我希望这对您有所帮助

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2011-03-01
        • 2011-06-26
        • 2016-08-12
        • 2017-06-22
        • 2010-12-17
        • 2011-12-10
        • 2017-03-16
        • 2015-08-09
        相关资源
        最近更新 更多