Upcoming invoices now have proper integer-index-encoded params #475
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
r? @brandur (But brandur already approved internally, so I'm going to go ahead and self-approve)
This ended up being a bit tricky to figure out where the problem was. It appears the upcoming invoices resource at some point took two URL params,
customerID
andinvoiceOptions
, whereinvoiceOptions
was an object with a bunch of parameters. At some point we scrappedinvoiceOptions
and promoted all of its options to be optional top-level fields in the request.So now we handle requests in one of two ways:
other_stuff
is in the request body.subscription_items
were not getting integer-index-encoded in the request body for requests with three parameters like: [customerID, one_field, subscription_items]. This fixes that by generalizing the existingencode
method used by subscriptions.I didn't touch the param-handling in case 1 (for backwards-compatibility, also because it works). And I guess we probably want to continue including the
subscription_items
in the request body in case 2 to skirt URL length limits.