ima*_*453 10 c# paypal paypal-sandbox asp.net-mvc-3
我下载了用于C#的Paypal SDK,我正在尝试在我的asp.net mvc应用程序中创建基本付款.我正在运行paypal开发站点中提到的确切代码,https://developer.paypal.com/webapps/developer/docs/api/#create-a-payment但是收到错误(下面的堆栈跟踪).我能够获得访问令牌,所以我假设应用程序能够与端点通信,但不确定为什么它会在Payment.create方法中抱怨.这是我第一次使用asp.net mvc所以对我可能做错了什么感到有点困惑,非常感谢任何帮助:)
我的Web.config文件包含以下部分:
<paypal>
<settings>
<add name="endpoint" value="https://api.sandbox.paypal.com" />
<add name="connectionTimeout" value="360000" />
<add name="requestRetries" value="1" />
<add name="ClientID" value="xyz" />
<add name="ClientSecret" value="abc" />
</settings>
</paypal>
Run Code Online (Sandbox Code Playgroud)
堆栈跟踪:
PayPal.Exception.PayPalException was unhandled by user code HResult=-2146233088 Message=Exception in HttpConnection Execute: Invalid HTTP response The remote server returned an error: (503) Server Unavailable. Source=PayPalCoreSDK StackTrace:
at PayPal.PayPalResource.ConfigureAndExecute[T](Dictionary`2 config, IAPICallPreHandler apiCallPreHandler, HttpMethod httpMethod, String resourcePath)
at PayPal.PayPalResource.ConfigureAndExecute[T](APIContext apiContext, HttpMethod httpMethod, String resource, String payload)
at PayPal.Api.Payments.Payment.Create(APIContext apiContext)
at PayPal.Api.Payments.Payment.Create(String accessToken)
at Requext.Controllers.EventController.CreatePayment() in c:\Users\Ishan\Source\Repos\requext.com\Requext\Controllers\EventController.cs:line 169
at Requext.Controllers.EventController.Test() in c:\Users\Ishan\Source\Repos\requext.com\Requext\Controllers\EventController.cs:line 95
at lambda_method(Closure , ControllerBase , Object[] )
at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.InvokeSynchronousActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass42.<BeginInvokeSynchronousActionMethod>b__41()
at System.Web.Mvc.Async.AsyncResultWrapper.<>c__DisplayClass8`1.<BeginSynchronous>b__7(IAsyncResult
_)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.End()
at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<>c__DisplayClass39.<BeginInvokeActionMethodWithFilters>b__33()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass4f.<InvokeActionMethodFilterAsynchronously>b__49() InnerException: PayPal.Exception.ConnectionException
HResult=-2146233088
Message=Invalid HTTP response The remote server returned an error: (503) Server Unavailable.
Source=PayPalCoreSDK
Response=""
StackTrace:
at PayPal.HttpConnection.Execute(String payLoad, HttpWebRequest httpRequest)
InnerException:
Run Code Online (Sandbox Code Playgroud)
我与 PayPal 合作了很多,我发现最好的方法是仅使用他们的 \xe2\x80\x9cREST\xe2\x80\x9d api(注意 \xe2\x80\x9c\xe2\x80\x9d)。\n由于 \xe2\x80\x9cnot divulgation\xe2\x80\x9d 协议,我无法发布我所做的解决方案,但相信我,只需完成将 SDK 移至垃圾箱并从其 POST api 开始,然后 \xe2\x80\x9cback POST\xe2 \x80\x9d api。它\xe2\x80\x99s 更简单。
\n 归档时间: |
|
查看次数: |
1327 次 |
最近记录: |