Pass an object as an argument to customer.list and coupons.list #37
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.
This is somewhat of situational PR but I think it's worth considering for the sake of consistent alignment of arguments.
I have some code that is looping through the
charge
,customer
andinvoice
endpoints, making calls to list methods programmatically. It seems that the expected arguments forcharge
andinvoice
both accept an object howevercustomer
expects two separate arguments forcount
andoffset
. This PR just adds support for the short hand.list({ count: x, offset: x}, fn)
arg style which makes for a slightly more consistent interface across these methods.Side note, I ran the tests before writing this PR and they seem to fail for me, so I wasn't able to confirm this PR against the tests. This could be due to the fact I was testing with a stripe connect oauth key but I'll do some work on the tests and see what I can figure out.
I've also got some reasons to implement more support for connect so I'll see what help I can offer there in future PR's.
Feedback appreciated.