Skip to content
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

stripe.charges.list #311

Closed
mikaelcabot opened this issue Mar 13, 2017 · 2 comments
Closed

stripe.charges.list #311

mikaelcabot opened this issue Mar 13, 2017 · 2 comments

Comments

@mikaelcabot
Copy link

Maybe I'm using this library/client wrongly...
I'm expecting the list to filter on customer, but it is not.

stripe.charges.list({
  stripe_account: 'acct_**********',
  customer: 'cus_**********',
  limit: 100
})

When doing a cURL it does filter on customer.

curl https://api.stripe.com/v1/charges?limit=100 \
  -H "Stripe-Account: acct_***********" \
  -u sk_test_*******************: \
  -d customer="cus_**********" \
  -d limit=100 \
  -G

Is this a bug/(lacking feature) in the javascript client or am I using it wrong?!

Thanks

@mikaelcabot
Copy link
Author

I see there is a PR (#306) that would fix this issue.
Any updates on if the PR is going the be merged? And if so when?

@jlomas-stripe
Copy link
Contributor

Hi @mikaelcabot! That PR is going to be refactored (when I get around to it...) so that it gives you an error when you try to combine them, as they really shouldn't be combined.

Your best bet here is to separate out the params and options into different objects, as this will give you the results you seek:

stripe.charges.list({
  customer: 'cus_**********',
  limit: 100
}, {
  stripe_account: 'acct_**********',
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants