【问题标题】:Asp.net Paypal Integration Test paymentAsp.net Paypal 集成测试支付
【发布时间】:2013-08-23 05:49:44
【问题描述】:

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

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 是我沙箱中的企业帐户。重定向后,我在我的沙盒中使用我的个人帐户来测试并购买了这个项目。当我尝试登录时,“请检查您的电子邮件地址和密码,然后重试”出现,我确定我已正确创建了我的个人帐户。 对不起我的英语不好。

【问题讨论】:

    标签: c# asp.net paypal paypal-sandbox


    【解决方案1】:

    网址必须是

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

    如果您使用的是 PayPal 沙盒测试帐户,请确保使用上述链接。

    【讨论】:

      猜你喜欢
      • 2018-12-10
      • 2015-09-02
      • 2015-07-11
      • 2021-04-26
      • 2014-06-03
      • 2015-06-25
      • 2011-11-11
      • 2021-02-11
      • 2021-01-30
      相关资源
      最近更新 更多