我们如何使用PayPal Payflow Pro帐户在同一网站中返回扣除额?
我正在使用PayPal Payflow Pro帐户作为我的一个申请。它确实进行了交易,但不会返回扣除额的细节。我使用的是首次使用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商家帐户 ->配置文件 ->销售首选项 ->网站付款首选项 ->网站付款的自动返回the tod doad doad doad doad of on,默认情况下应该关闭它交易后,请确保该值存储在您的数据库中。我希望这对您有所帮助