请找到以下用于过滤账单的代码,即使我通过了 resultperpage>10,它也只返回 10 条排序记录。
public IEnumerable<Intuit.Ipp.Data.Qbo.Bill> FilterBills(DataServices dataServices, int startPage, int resultsPerPage, DateTime After, DateTime Before)
{
Intuit.Ipp.Security.OAuthRequestValidator oAuthRequestValidator = ((Intuit.Ipp.Security.OAuthRequestValidator)dataServices.ServiceContext.RequestValidator);
OAuthConsumerContext consumerContext = new OAuthConsumerContext
{
ConsumerKey = oAuthRequestValidator.ConsumerKey,
SignatureMethod = SignatureMethod.HmacSha1,
ConsumerSecret = oAuthRequestValidator.ConsumerSecret
};
OAuthSession oSession = new OAuthSession(consumerContext, "https://oauth.intuit.com/oauth/v1/get_request_token",
"https://workplace.intuit.com/Connect/Begin",
"https://oauth.intuit.com/oauth/v1/get_access_token");
oSession.AccessToken = new TokenBase
{
Token = oAuthRequestValidator.AccessToken,
ConsumerKey = oAuthRequestValidator.ConsumerKey,
TokenSecret = oAuthRequestValidator.AccessTokenSecret
};
var body = "PageNum={0}&ResultsPerPage={1}&Filter=LastUpdatedTime :AFTER: {2} :AND: LastUpdatedTime :BEFORE: {3} & Sort=LastUpdatedTime HighToLow";
body = String.Format(body, startPage, resultsPerPage, After.ToString("yyyy-mm-ddTHH:MM:ssz"), Before.ToString("yyyy-mm-ddTHH:MM:ssz"));
IConsumerRequest conReq = oSession.Request();
conReq = conReq.Post().WithRawContentType("application/x-www-form-urlencoded").WithRawContent(System.Text.Encoding.ASCII.GetBytes(body)); ;
conReq = conReq.ForUrl(dataServices.ServiceContext.BaseUrl + "bills/v2/" + dataServices.ServiceContext.RealmId);
conReq = conReq.SignWithToken();
Intuit.Ipp.Data.Qbo.SearchResults searchResults = (Intuit.Ipp.Data.Qbo.SearchResults)dataServices.ServiceContext.Serializer.Deserialize<Intuit.Ipp.Data.Qbo.SearchResults>(conReq.ReadBody());
IEnumerable<Intuit.Ipp.Data.Qbo.Bill> SearchResult = ((Intuit.Ipp.Data.Qbo.Bills)(searchResults.CdmCollections)).Bill;
return SearchResult;
}
发送请求后,我将响应作为 10 个已排序的账单记录而没有出现任何错误。我正在使用 IPDotNetDevKit 2.1.12.0 版本。
请查看此过滤问题。