Asp.net贝宝返回URL要求 [英] Asp.net Paypal Return Url Requirement

查看:108
本文介绍了Asp.net贝宝返回URL要求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用asp.net为我的测试程序。

I'm using asp.net for my test program.

//string Server_URL = "https://www.paypal.com/ph/cgi-bin/webscr?";
            string Server_URL = ConfigurationManager.AppSettings["URL"].ToString();

            //Assigning Cmd Path as Statically to Parameter
            string cmd = "_xclick";

            //Assigning business Id as Statically to Parameter
            string business = ConfigurationManager.AppSettings["BusinessName"].ToString();

            //Assigning item name as Statically to Parameter
            string item_name = lblProductCode.Text;

            //Passing Amount as Statically to parameter 
            double amount = Convert.ToDouble(_lblPrice.Text);
            Session["Amount"] = amount;

            //Passing Currency as Statically to parameter
            string currency_code = "PHP";

            string redirect = "";

            //Pass your Server_Url,cmd,business,item_name,amount,currency_code variable.        
            redirect += Server_URL;
            redirect += "cmd=" + cmd;
            redirect += "&business=" + business;
            redirect += "&first_name=" + Session["id"].ToString();
            redirect += "&item_name=" + item_name;
            redirect += "&amount=" + amount;
            redirect += "&quantity=1";
            redirect += "&currency_code=" + currency_code;

            redirect += "&return=http://localhost:49457/Fun/Success.aspx";
            redirect += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();

            Session["Redirect"] = redirect;

            Response.Redirect(redirect);

在网站付款preferences现在
我设置了返回URL,我在我的code回报率相同。
它说:我们无法验证您所输入的网址。请检查您的输入,然后再试一次。

Now in Website Payment Preferences I set the return URL same in my return in my code. it said "We were unable to validate the URL you have entered. Please check your entry and try again."

是否有可能在返回URL ???

Is it possible to insert a localhost url in the return url???

推荐答案

在贝宝沙箱网站付款参考是有回报的URL的网站,如果你进入那里,你的本地开​​发服务器的URL,永远不会work.You可以'做T,它的一个基本的东西,你应该fimiliar和逻辑上不可能,怎么会recogninze当地url.You可以将返回的URL在您发送到PayPal这样的Web请求参数:

In the paypal sandbox Web payment reference there is a return url site, if you are entering there your local development server url, that will never work.You can't do that its a basic thing that you should be fimiliar and its logically not possible, how it will recogninze your local url.You can set return url as parameter in the web request that you are sending to paypal like this:

redirecturl += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString();

//Failed return page url
redirecturl += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();

有没有必要设置返回URL那里,我们在Web请求发送它

There is no need to set return url there, as we are sending it in the web request

这篇关于Asp.net贝宝返回URL要求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆