1
我正嘗試從PayPal下載交易記錄。爲此,我致電TransactionSearch
獲取日期範圍內的基本交易清單。然後我打電話GetTransactionDetails
以獲取每筆交易的全部詳細信息。PayPal Classic API驗證一個電話,但不是下一個
using (var client = new PayPalService.PayPalAPIInterfaceClient())
{
var credentials = new PayPalService.CustomSecurityHeaderType
{
Credentials = new PayPalService.UserIdPasswordType
{
Username = "MyUserName",
Password = "MyPassword",
Signature = "MySignature"
}
};
TransactionSearchReq request = new TransactionSearchReq();
request.TransactionSearchRequest = new TransactionSearchRequestType();
request.TransactionSearchRequest.StartDate = DateTime.Now.AddHours(-12);
request.TransactionSearchRequest.EndDate = DateTime.Now;
request.TransactionSearchRequest.Version = "117.0";
TransactionSearchResponseType transactionSearchResponseType = client.TransactionSearch(ref credentials, request);
foreach (PaymentTransactionSearchResultType t in transactionSearchResponseType.PaymentTransactions)
{
var reqType = new GetTransactionDetailsRequestType
{
TransactionID = t.TransactionID,
Version = "117.0"
};
reqType.DetailLevel = new DetailLevelCodeType[1];
reqType.DetailLevel[0] = DetailLevelCodeType.ReturnAll;
var treq = new GetTransactionDetailsReq
{
GetTransactionDetailsRequest = reqType
};
GetTransactionDetailsResponseType transaction = client.GetTransactionDetails(ref credentials, treq);
}
}
第一次致電TransactionSearch
的電話會返回一個交易清單。到GetTransactionDetails
第二次調用返回一個錯誤:
Error Code: "10002"
Long Message: "You do not have permissions to make this API call"
Short Message: "Authentication/Authorization Failed"
Correlation ID: 67970b9729a82
Ack: Failure
Build: 000000
Version: "117.0"
Any: null
PropertyChanged: null
我有三重檢查,我傳入呼叫TransactionId
是我的有效交易之一,它是。
有沒有人見過這個?
您可以發佈PayPal的完整回覆,包括相關ID嗎? – Eshan 2014-10-09 12:09:05
@Eshan謝謝你的迴應。我在帖子中增加了更多內容。 – Fred 2014-10-09 12:17:52
我試圖檢查我與這個相關ID,但無法找到太多。您可以在www.paypal.com/mts上提交一張門票並在此處將我的門票發給我。 – Eshan 2014-10-09 23:15:18