I can't configure Paypal to use in ASP.NET MVC

2019-07-23 18:28发布

I want to integrate PayPal to my application. I have read a lot of articles, including official documentation. I.e. http://www.codeproject.com/Articles/870870/Using-Paypal-Rest-API-with-ASP-NET-MVC https://github.com/paypal/PayPal-NET-SDK and do step by step. No result :(

First at all, I installed package PayPal from Nuget:

Install-Package Paypal

Secondly, I went to my paypal account and created test application:

enter image description here

My web.config:

enter image description here

when I call

        var config = ConfigManager.Instance.GetProperties();

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

it throws exception:

Retried 1 times.... Exception in PayPal.HttpConnection.Execute(). Check log for more details.

(which log should I check - don't understand...)

when I check by debugger I see, that object config has configurations clientId and clientSecret correctly

enter image description here

what is wrong (or maybe I lost something)?

Also, documentation has link https://www.sandbox.paypal.com/ , but I can't open this link at all. Maybe, I should allow something more?

2条回答
闹够了就滚
2楼-- · 2019-07-23 19:06

It's network proxy that blocking Paypal API request

查看更多
可以哭但决不认输i
3楼-- · 2019-07-23 19:21

It does not work because my IP address in not allowed for it (restriction by country). More detail information about it https://developer.paypal.com/docs/faq/#international-developer-questions

Thank you, Andrew Angell

查看更多
登录 后发表回答