gpt4 book ai didi

asp.net - 我们如何使用 Paypal Payflow pro 帐户在同一网站退还金额

转载 作者:太空宇宙 更新时间:2023-11-03 16:03:37 24 4
gpt4 key购买 nike

我们如何使用 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;
}

关于asp.net - 我们如何使用 Paypal Payflow pro 帐户在同一网站退还金额,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12947155/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com