4
我目前使用asp.net與貝寶集成。我已經看過論壇上的其他教程,但它似乎已經老了。 Paypal今天有一個新的UI,這就是爲什麼我有一些困難。我已註冊w/developer.paypal.com,並在沙箱帳戶中創建業務類型和個人類型帳戶。現在這裏是我的代碼Asp.net貝寶集成測試付款
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 = "[email protected]";// 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 += "¤cy_code=" + currency_code;
redirect += "&return=" + ConfigurationManager.AppSettings["SuccessURL"].ToString();
redirect += "&cancel_return=" + ConfigurationManager.AppSettings["FailedURL"].ToString();
Response.Redirect(redirect);
我把這段代碼放在一個按鈕中,所以當這個按鈕被觸發時,這段代碼將運行。 正如您所見,[email protected]是我的沙箱中的商務帳戶。重定向後,我用我的沙箱中的個人帳戶來測試併購買此項目。當我嘗試登錄時,「請檢查您的電子郵件地址和密碼,然後重試」出現,並且我確信我已正確創建了我的個人帳戶。 對不起,我的英語不好。