简体   繁体   中英

Asp.net Paypal Integration Test payment

I'm currently using asp.net to integrate with 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. I've signed up w/ developer.paypal.com and create a Business Type and Personal Type account in sandbox account. 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. 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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