Paypal Payflow プロアカウントを使用して、同じウェブサイトで控除額を返すにはどうすればよいですか?
アプリケーションの 1 つに Paypal Payflow プロ アカウントを使用しています。トランザクションは行いますが、控除額の詳細は返しません。Paypal Payflow アカウントを初めて使用しています。ですから、以前にそのような仕事をしたことがある人がいたら、親切に私と共有してください。
こんにちは、私はこれを行いました。解決策が必要な人は、以下を参照してください。
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 マーチャント アカウントに移動します-->プロファイル-->販売設定-->ウェブ ペイメント設定-->ウェブ ペイメントの自動返品ラジオ ボタンをオンにします。デフォルトではオフにする必要があります。取引後、値があなたのdatabase.i これがあなたのお役に立てば幸いです