Skip to content

TypeError - no implicit conversion of Hash into String when attempting to pay an invoice #809

@linkyndy

Description

@linkyndy

Hello,

We're getting the following error when attempting to pay:

Stripe::Invoice.pay(id: stripe_subscription.latest_invoice, expand: ['payment_intent'])

an invoice:

TypeError - no implicit conversion of Hash into String:
	/Users/andrei/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/stripe-4.21.0/lib/stripe/api_resource.rb:73:in `escape'
	/Users/andrei/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/stripe-4.21.0/lib/stripe/api_resource.rb:73:in `block in custom_method'

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 as expand.

This works when retrieving a subscription, for example:

Stripe::Subscription.retrieve(id: 'whatever', expand: ['latest_invoice.payment_intent'])

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions