简体   繁体   English

Asp.net Paypal集成测试支付

[英]Asp.net Paypal Integration Test payment

I'm currently using asp.net to integrate with paypal. 我目前正在使用asp.net与paypal集成。 I've look to other tutorials in forums but it seems to old. 我看过论坛中的其他教程,但似乎已经过时了。 Paypal has a new UI this day that's why I'm having some difficulties. Paypal今天有一个新的用户界面,这就是我遇到一些困难的原因。 I've signed up w/ developer.paypal.com and create a Business Type and Personal Type account in sandbox account. 我已经注册了developer.paypal.com并在沙盒帐户中创建了一个商业类型和个人类型帐户。 now here is my code 现在这是我的代码

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);

I put this code in a button so when that button was triggered this code will run. 我将此代码放在一个按钮中,因此当触发该按钮时,此代码将运行。 As you can see Test1@gmail.com is my Business account in my sandbox. 正如您所见,Test1@gmail.com是我沙箱中的商家帐户。 After redirecting, I used my Personal account in my sandbox to test and buys this item. 重定向后,我在沙盒中使用我的个人帐户来测试并购买此项目。 And when i try to log in, "Please check your email address and password and try again" appear and I'm sure I've created my personal account correctly. 当我尝试登录时,“请检查您的电子邮件地址和密码然后重试”,我确定我已经正确创建了我的个人帐户。 Sorry for my bad English. 对不起,我的英语不好。

The URL must be 网址必须是

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

If you are using the PayPal SandBox test Account, make sure you use the above link. 如果您使用的是PayPal SandBox测试帐户,请确保使用上述链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM