.NET AdaptivePayment SDK:PaymentDetails()抛出一个ConnectionException(404)

时间:2013-10-22 21:14:03

标签: paypal paypal-sandbox paypal-adaptive-payments

我正在呼叫AdaptivePaymentService.PaymentDetails()以获取付款的付款详细信息,并且它正在抛出表示404的ConnectionException。为了调试问题,我下载了AdaptivePayment SDK以及Core的源代码SDK并逐步完成代码,特别是HttpRequestPaypal.HttpConnection.Execute()中执行的位置。

好像所有配置变量都是从web.config中读取的:

enter image description here

底层httpRequest中的地址看起来是正确的:

enter image description here

有效负载看起来是正确的:

enter image description here

但是,抛出WebException并返回以下响应:

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>404 Not Found</title>
</head><body>
<h1>Not Found</h1>
<p>The requested URL /cgi-bin/ppapi was not found on this server.</p>
<p>Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.</p>
<hr>
<address>Apache Server at <a href="mailto:ppmtps@paypal.com">api.sandbox.paypal.com</a> Port 443</address>
</body></html>

非常感谢任何帮助。

1 个答案:

答案 0 :(得分:1)

由于您在配置中配置了ClientId / Secret和3令牌凭据(API用户名,密码,签名),因此检测到端点不正确,从而使REST API具有更高的优先级。请删除客户端ID /密码配置,您应该看到端点正确设置为https://svcs.sandbox.paypal.com/AdaptivePayments/PaymentDetails