PayPal Sandbox返回内部服务错误

时间:2013-08-27 17:03:46

标签: paypal paypal-sandbox

我正在尝试使用PayPal Sandbox来测试自动信用卡处理,但遇到了问题。当我收取 $ 105 的费用时,我得到一个INTERNAL_SERVICE_ERROR,调试ID为de753957a889d。如果我返回并将金额更改为其他内容,例如 $ 115 ,则费用会按预期进行。我尝试了几种不同的金额, $ 105 似乎是唯一一个给我错误的。

以下是日志文件中的行:

2013-08-27 12:45:36,570 [10] DEBUG PayPal.Manager.ConnectionManager [(null)] grant_type=client_credentials

2013-08-27 12:45:37,376 [10] DEBUG PayPal.Manager.ConnectionManager [(null)] Service response

2013-08-27 12:45:37,376 [10] DEBUG PayPal.Manager.ConnectionManager [(null)] {"scope":"htts://api.paypal.com/v1/payments/.* htts://api.paypal.com/v1/vault/credit-card htts://api.paypal.com/v1/vault/credit-card/.* openid","access_token":"BJ7.168BhK3u0EgZ.MQgUABpdnTropRiXdCQ7ALrBHg","token_type":"Bearer","app_id":"APP-80W284485P519543T","expires_in":28800}

2013-08-27 12:45:37,698 [10] DEBUG PayPal.PayPalResource [(null)] Content-Type:application/json

2013-08-27 12:45:37,698 [10] DEBUG PayPal.PayPalResource [(null)] Authorization:Bearer BJ7.168BhK3u0EgZ.MQgUABpdnTropRiXdCQ7ALrBHg

2013-08-27 12:45:37,698 [10] DEBUG PayPal.PayPalResource [(null)] User-Agent:PayPalSDK/rest-sdk-dotnet 0.7.3 ;lang=DOTNET;v=4.0.30319.1008;bit=64;os=Windows 7 6.1.7601.65536;

2013-08-27 12:45:37,698 [10] DEBUG PayPal.PayPalResource [(null)] PayPal-Request-Id:14504bda-98c3-4b14-90fd-083663e80bfd

2013-08-27 12:45:37,789 [10] DEBUG PayPal.Manager.ConnectionManager [(null)] {"intent":"sale","payer":{"payment_method":"credit_card","funding_instruments":[{"credit_card":{"number":"4417119669820331","type":"visa","expire_month":3,"expire_year":2015,"cvv2":"123","first_name":"David","last_name":"Krejci","billing_address":{"line1":"300 Technology Square","city":"Cambridge","country_code":"US","postal_code":"02139","state":"MA"}}}]},"transactions":[{"amount":{"currency":"USD","total":"105","details":{"shipping":"0","subtotal":"105","tax":"0"}},"description":"B4M Reg"}]}

2013-08-27 12:45:42,975 [10] ERROR PayPal.Manager.ConnectionManager [(null)] Error Response: {"name":"INTERNAL_SERVICE_ERROR","message":"An internal service error has occurred","information_link":"htts://developer.paypal.com/webapps/developer/docs/api/#INTERNAL_SERVICE_ERROR","debug_id":"de753957a889d"}

2013-08-27 12:45:42,976 [10] INFO  PayPal.Manager.ConnectionManager [(null)] Got InternalServerError status code from server

2013-08-27 12:45:43,035 [10] ERROR PayPal.Exception.PayPalException [(null)] Exception in HttpConnection Execute: Stream was not readable.
PayPal.Exception.PayPalException: Exception in HttpConnection Execute: Stream was not readable. ---> System.ArgumentException: Stream was not readable.
   at System.IO.StreamReader..ctor(Stream stream, Encoding encoding, Boolean detectEncodingFromByteOrderMarks, Int32 bufferSize)
   at System.IO.StreamReader..ctor(Stream stream)
   at PayPal.HttpConnection.Execute(String payLoad, HttpWebRequest httpRequest)
   --- End of inner exception stack trace ---

2 个答案:

答案 0 :(得分:2)

您是否在沙箱帐户上启用了“否定测试”? https://developer.paypal.com />应用程序>沙箱帐户>找到您的帐户>点击“个人资料”>设置。

负面测试允许您通过将特定错误代码作为“AMT”值传递来触发特定错误代码,从而测试我们的经典API的特定错误条件。
例如,对于API错误代码12345,您可以设置AMT=123.45 对于您的错误情况,我看到我们在内部返回API错误代码10500。这让我非常怀疑你的沙箱帐户已经开启了“否定测试”。

答案 1 :(得分:0)

如果您使用相同的卡详细信息很多次,则可能会遇到此问题。 请使用不同的卡,否则您将无法获得此类问题。