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::InvalidRequestError when using auto_paging_each in Stripe::Customer.list_payment_methods #1064

Closed
alebian opened this issue Jun 6, 2022 · 2 comments
Assignees
Labels

Comments

@alebian
Copy link

alebian commented Jun 6, 2022

Describe the bug

I have a customer with multiple payment methods. This code:

payment_methods = Stripe::Customer.list_payment_methods(customer_id, type: 'card')
payment_methods.auto_paging_each do |pm|
  ...
end

Throws Stripe::InvalidRequestError ((Status 400) (Request req_pc1CMt5PpyX1EE) Missing required param: type.)

Without looking at the code and just guessing, it would seem that the auto_paging_each method is not sending the original parameters in the subsequent requests

To Reproduce

Have a customer with more than one page of payment methods and run

Stripe::Customer.list_payment_methods(customer_id, type: 'card').auto_paging_each do |pm|
  ...
end

Expected behavior

The expected behavior is to get the page in the iteration without the error.

Code snippets

No response

OS

Ubuntu

Language version

Ruby 2.7.4

Library version

v6.2.0

API version

Default

Additional context

Once I removed some repeated payment methods from the customer the code started working again

@alebian alebian added the bug label Jun 6, 2022
@remi-stripe
Copy link
Contributor

@alebian Thanks for the report, this is definitely a bug. We're looking into a fix!

@pakrym-stripe pakrym-stripe self-assigned this Jun 7, 2022
@pakrym-stripe
Copy link
Contributor

Confirmed fixed in #1071

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

No branches or pull requests

3 participants