繁体   English   中英

PayPal Webservice for TransactionSearch不遵守StartDate / EndDate

[英]PayPal Webservice for TransactionSearch does not respect StartDate/EndDate

我正在努力调用PayPal的Web服务来执行TransactionSearch,如下所示:

AccountType accountType = AccountType.Live;
tblPayPalAccount account = PayPalAPICallHelperSOAP.GetAccount(accountType);
DateTime endDate = new DateTime(2012, 1, 1);
DateTime startDate = new DateTime(2012, 12, 31);


using (PayPalAPIInterfaceClient client = new PayPalAPIInterfaceClient())
{
    client.Endpoint.Address = new System.ServiceModel.EndpointAddress("https://api-3t.paypal.com/2.0");
    UserIdPasswordType userIdPasswordType = PayPalAPICallHelperSOAP.GetUserIdPasswordType(account);
    CustomSecurityHeaderType header = new CustomSecurityHeaderType();
    header.Credentials = userIdPasswordType;

    TransactionSearchReq request = new TransactionSearchReq();

    request.TransactionSearchRequest = new TransactionSearchRequestType();

    request.TransactionSearchRequest.Version = account.version;
    request.TransactionSearchRequest.StartDate = startDate;

    request.TransactionSearchRequest.EndDate = endDate;

    TransactionSearchResponseType transactionSearchResponseType = client.TransactionSearch(ref header, request);
}

从今天开始,无论我给StartDate / EndDate传递什么值,我总是会得到67个结果(在本例中为2012,但我仅获得最近几周的值)

我想念什么吗? 这确实困扰了我好一阵子,无论我设置了什么,结果始终是相同的。

request.TransactionSearchRequest.EndDateSpecified = true;

告诉网络服务设置了结束日期。 这样可以解决您的问题。 不知道为什么需要它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM