-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error getting objects by id #609
Comments
Hello @glennsdavis, thanks for creating this issue. It is not well documented, but the public T First()
{
Dictionary<string, object> firstParams = new Dictionary<string, object>(QueryParams);
firstParams["limit"] = 1;
var pager = RecurlyClient.MakeRequest<Pager<T>>(Method.GET, Url, null, firstParams, Options);
return pager.Data.FirstOrDefault();
} If you're operating with a known list of |
Douglas,
Thank you for the quick response. I did not see the GetInvoice method in the SDK.
Can I create a purchase for a credit card vaulted in Braintree? Would I set GatewayToken and GatewayCode fields on the BillingInfoCreate object for the CreatePurchase method? What is the GatewayCode for Braintree?
Thank you.
On Wednesday, February 3, 2021, 09:14:41 AM PST, Douglas Miller <notifications@github.com> wrote:
Hello @glennsdavis, thanks for creating this issue.
It is not well documented, but the First() method will specify the limit parameter to the value 1. As such, it should not be used when specifying ids.
public T First()
{
Dictionary<string, object> firstParams = new Dictionary<string, object>(QueryParams);
firstParams["limit"] = 1;
var pager = RecurlyClient.MakeRequest<Pager<T>>(Method.GET, Url, null, firstParams, Options);
return pager.Data.FirstOrDefault();
}
If you're operating with a known list of ids then I would suggest using the get_subscription and get_invoice operations if you're only interested in a single subscription/invoice. Otherwise, you should just iterate over the Pager results.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Ah okay, glad to share the info then! As far as braintree is concerned, I think that Recurly support would be better equipped to answer those types of questions. |
Close this issue. |
Warning: Github issues are not an official support channel for Recurly. If you have an urgent request we suggest you contact us through an official channel: support@recurly.com or https://recurly.zendesk.com
Describe the bug
I get an error when using the API to get objects by id. The error is "Please remove the following unpermitted parameters from your request: limit."
The reference documentation states that the ids parameter cannot be used with any other ordering or filtering parameters (limit, order, sort, begin_time, end_time, etc). The API defaults "limit" parameter to null, but it does not appear the API is excluding the limit parameter in the request to the server.
public Pager ListAccountSubscriptions(string accountId, string ids = null, int? limit = null, string order = null, string sort = null, DateTime? beginTime = null, DateTime? endTime = null, string state = null, RequestOptions options = null);
To Reproduce
Pager subscriptions = client.ListAccountSubscriptions("code-2938", "obdmcbsp424h");
Subscription subscription = subscriptions.First();
Pager invoices = client.ListAccountInvoices("code-2938", "obdmcbsqilaa");
Invoice invoice = invoices.First();
Expected behavior
Calls do not throw an exception and the requested object is returned.
Your Environment
SDK: Recurly V3 API - v3.18.0
Language: C#
Framework: .NET 5.0
The text was updated successfully, but these errors were encountered: