1

Paypal Payflow プロアカウントを使用して、同じウェブサイトで控除額を返すにはどうすればよいですか?

アプリケーションの 1 つに Paypal Payflow プロ アカウントを使用しています。トランザクションは行いますが、控除額の詳細は返しません。Paypal Payflow アカウントを初めて使用しています。ですから、以前にそのような仕事をしたことがある人がいたら、親切に私と共有してください。

4

2 に答える 2

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;
    }
于 2012-10-19T04:47:41.257 に答える
0

あなたの PayPal マーチャント アカウントに移動します-->プロファイル-->販売設定-->ウェブ ペイメント設定-->ウェブ ペイメントの自動返品ラジオ ボタンをオンにします。デフォルトではオフにする必要があります。取引後、値があなたのdatabase.i これがあなたのお役に立てば幸いです

于 2012-10-18T13:42:45.900 に答える