-
Notifications
You must be signed in to change notification settings - Fork 548
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
TypeError - no implicit conversion of Hash into String when attempting to pay an invoice #809
Comments
Hi @linkyndy. For historical / backwards compatibility reasons, the The stripe-ruby/lib/stripe/api_resource.rb Line 95 in 267eae5
Originally, Other API methods that affect a specific resource expect different arguments for the ID and for actual request parameters: stripe-ruby/lib/stripe/api_resource.rb Line 72 in 267eae5
So you need to change your call to Stripe::Invoice.pay(stripe_subscription.latest_invoice, {expand: ['payment_intent']}) We should probably change the signature of |
Great analysis OB.
I'm a little on the fence. On one hand, I'd certainly prefer that Maybe we could introduce a deprecation message and then wait a long time before changing it to give people as much time to upgrade as possible, but even that might be painful in its own way. So yeah, I'm not too sure :) Possibly if we do a big breaking change in the future we could pull this in, but I'd probably hold off until then. |
Thank you both for your answers. It may be a pain to change this interface, but keep in mind developers also feel pain and get confused by an inconsistent interface. I would make the Thanks for your hard work! |
Raises a slightly more helpful error message when passing a non-string to a custom method (currently, it reads "no implicit conversion of Hash into String", which is terrible). This a partial remediation for the problem encountered in #809.
Hello,
We're getting the following error when attempting to pay:
an invoice:
I would assume this doesn't work because
Stripe::Invoice.pay
expects a positional argument for the ID, while that way, it cannot accept optional arguments, such asexpand
.This works when retrieving a subscription, for example:
The text was updated successfully, but these errors were encountered: