我无法配置Paypal在ASP.NET MVC应用程序

时间:2016-02-26 22:37:30

标签: asp.net-mvc paypal-sandbox paypal

我想将PayPal集成到我的应用程序中。 我看过很多文章,包括官方文档。即 http://www.codeproject.com/Articles/870870/Using-Paypal-Rest-API-with-ASP-NET-MVC https://github.com/paypal/PayPal-NET-SDK 并一步一步地做。没有结果:(

首先,我从Nuget安装了包PayPal:

  

安装包Paypal

其次,我访问了我的paypal帐户并创建了测试应用程序:

enter image description here

我的web.config:

enter image description here

当我打电话

        var config = ConfigManager.Instance.GetProperties();

        // Use OAuthTokenCredential to request an access token from PayPal
        var accessToken = new OAuthTokenCredential(config).GetAccessToken();

它抛出异常:

  

重试1次.... PayPal.HttpConnection.Execute()中的例外情况。   查看日志以获取更多详细信息。

(我应该检查哪个日志 - 不明白......)

当我通过调试器检查时,我看到,该对象 config 正确配置clientId和clientSecret

enter image description here

出了什么问题(或者我丢了东西)?

此外,文档已链接https://www.sandbox.paypal.com/,但我根本无法打开此链接。也许,我应该允许更多的东西?

2 个答案:

答案 0 :(得分:0)

它不起作用,因为我的IP地址不允许(按国家/地区限制)。有关它的更多详细信息https://developer.paypal.com/docs/faq/#international-developer-questions

谢谢Andrew Angell

答案 1 :(得分:0)

是阻止Paypal API请求的网络代理