gpt4 book ai didi

c# - TransactionSearch 的 PayPal Web 服务不遵守 StartDate/EndDate

转载 作者:太空宇宙 更新时间:2023-11-03 16:35:08 25 4
gpt4 key购买 nike

我正在努力调用 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);
}

从今天开始我总是得到 67 个结果,不管我传递给 StartDate/EndDate 的值是多少(在本例中是 2012 年,但我只得到最近几周的值)

我错过了什么吗?这真的困扰了我很长一段时间,无论我设置什么,结果总是一样的。

最佳答案

request.TransactionSearchRequest.EndDateSpecified = true;

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

关于c# - TransactionSearch 的 PayPal Web 服务不遵守 StartDate/EndDate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16078206/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com