【问题标题】:Paypal sandbox integration with asp.net c#Paypal 沙箱与 asp.net c# 的集成
【发布时间】:2013-06-17 13:21:45
【问题描述】:

我正在使用 PayPal 沙盒解决方案。我通过以下方式发送了此请求:

   string redirecturl = "";
                redirecturl += "https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_xclick&business=" + ConfigurationManager.AppSettings["paypalemail"].ToString();
                redirecturl += "&first_name=Liton";
                redirecturl += "&city=Dhaka";
                redirecturl += "&state=Baridhara";
                redirecturl += "&item_name=Recharge";
                redirecturl += "&amount=" + money;
                redirecturl += "&shipping=0";
                redirecturl += "&handling=0";
                redirecturl += "&tax=0";
                redirecturl += "&quantity=1";
                redirecturl += "&currency=USD";
                redirecturl += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString();
                redirecturl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();    
                Response.Redirect(redirecturl);

成功付款后,我无法获得 Paypal 返回值。如果成功或失败,我如何获得返回值?

        tranref = Request.QueryString["tx"].ToString();
        transtat = Request.QueryString["st"].ToString();
        tranamt = Request.QueryString["amt"].ToString();
        trancur = Request.QueryString["cc"].ToString();

我正在尝试以这种方式在成功页面中获取值,但所有值均为空。请帮助我获取返回值。

【问题讨论】:

    标签: c# asp.net paypal sandbox


    【解决方案1】:

    您需要使用支付数据传输 (PDT) 来获取并验证 Payments Standard 交易的退货信息。这里有一些示例:https://github.com/paypal/pdt-code-samples

    如果您需要获取详细信息,则可能需要将rm 变量设置为1,如果您需要POST 信息,则可能需要设置2。使用 PDT,返回方法将始终是 GET。

    【讨论】:

      猜你喜欢
      • 2015-05-23
      • 2012-02-21
      • 1970-01-01
      • 1970-01-01
      • 2011-09-23
      • 2010-12-19
      • 2021-12-05
      • 2012-11-09
      相关资源
      最近更新 更多