C# Asp.net贝宝集成测试支付

C# Asp.net贝宝集成测试支付,c#,asp.net,paypal,paypal-sandbox,C#,Asp.net,Paypal,Paypal Sandbox,我目前正在使用asp.net与paypal集成。我在论坛上看过其他教程,但它似乎已经过时了。贝宝今天有了一个新的用户界面,这就是为什么我遇到了一些困难。我已经注册了w/developer.paypal.com,并在sandbox帐户中创建了一个业务类型和个人类型的帐户。这是我的代码 string Server_URL = "https://www.paypal.com/ph/cgi-bin/webscr?"; //Assigning Cmd Path as Statically to Para

我目前正在使用asp.net与paypal集成。我在论坛上看过其他教程,但它似乎已经过时了。贝宝今天有了一个新的用户界面,这就是为什么我遇到了一些困难。我已经注册了w/developer.paypal.com,并在sandbox帐户中创建了一个业务类型和个人类型的帐户。这是我的代码

string Server_URL = "https://www.paypal.com/ph/cgi-bin/webscr?";

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

//Assigning business Id as Statically to Parameter
string business = "Test1@gmail.com";// Enter your business account here 

//Assigning item name as Statically to Parameter
string item_name = "Item 1";

//Passing Amount as Statically to parameter 
double amount = 30000.00;

//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=" + "Name";
redirect += "&item_name=" + item_name;
redirect += "&amount=" + amount;
redirect += "&quantity=1";
redirect += "&currency_code=" + currency_code;

redirect += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString();
redirect += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();

Response.Redirect(redirect);
我把这个代码放在一个按钮里,当这个按钮被触发时,这个代码就会运行。 如你所见Test1@gmail.com是我的商业账户在我的沙箱里。重定向后,我在沙箱中使用我的个人帐户测试并购买此项目。当我尝试登录时,“请检查您的电子邮件地址和密码,然后再试一次”会出现,我确信我已经正确创建了我的个人帐户。 对不起,我的英语不好。

URL必须是

string Server_URL = "https://www.sandbox.paypal.com/cgi-bin/webscr?";
如果您使用的是PayPal沙盒测试帐户,请确保使用上述链接