Asp.net Paypal Integration Test payment

I am currently using asp.net to integrate with paypal. I look at other tutorials in the forums, but it seems old. A new user interface has appeared on Paypal that day, so I am having some difficulties. I registered w / developer.paypal.com and created an account like Business Type and Personal Type in the 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 this button was launched, this code will work. As you can see, Test1@gmail.com is my "Business" account in my sandbox. After the redirect, I used my personal account in my sandbox to test and purchase this item. And when I try to log in, "Please check your email address and password and try again," and I'm sure I created my personal account correctly. Sorry for my bad english.

+4
source share
1 answer

URL must be

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

If you are using a PayPal SandBox test account, make sure you use the link above.

+3
source

Source: https://habr.com/ru/post/1498103/


All Articles