stripe-ruby icon indicating copy to clipboard operation
stripe-ruby copied to clipboard

Unable to retrieve Transfer Reversal while expanding the transfer object

Open davidrichey opened this issue 1 year ago • 6 comments

Describe the bug

Unable to retrieve Transfer Reversal while expanding the transfer object as the API Docs state. The expected expand addition to the Stripe Transfer retrieve_reversal raises a NoMethodError.

I noticed the NestedResource retrieve_ does not account for params as the update, delete & list methods do.

To Reproduce

  1. Retrieve a transfer reversal with the expand key.

Note: The code snippet is generated from the Stripe Shell

Expected behavior

Retrieves the Transfer Reversal Object with the transfer expanded

Code snippets

Stripe::Transfer.retrieve_reversal(
  'tr_xxx',
  'trr_xxx',
  { expand: ['transfer'] }
)
NoMethodError: undefined method `strip' for ["transfer"]:Array


### OS

macOS

### Language version

Ruby 3.0.1

### Library version

stripe-ruby v11.2.0

### API version

2024-04-10

### Additional context

_No response_

davidrichey avatar May 02 '24 15:05 davidrichey

@davidrichey Thanks for the report and sorry for the trouble. We have a bug in the code here I think where we don't pass params properly. We'll look into this and work on a fix but it might take a bit of time to get this fully tested and ready to roll out to avoid breaking existing calls.

remi-stripe avatar May 02 '24 15:05 remi-stripe

Thanks @remi-stripe, that's what I was thinking too. I played around with it a bit and added a PR, as well as, an additional test. If there is anything additional to add, let me know!

davidrichey avatar May 02 '24 15:05 davidrichey

Ah neat, I missed your PR 🤦 The main risk for us is figuring out if this change could break anyone's code (this logic has been broken for ~4 years) so if we changed it and someone's code would now fail it'd be a problem

remi-stripe avatar May 02 '24 16:05 remi-stripe

@remi-stripe in the meantime, do you know any workarounds until we would be able to get something like this implemented?

davidrichey avatar May 07 '24 19:05 davidrichey

Unfortunately no I can't think of a viable one but we are working on getting your change integrated in a non-breaking way which should hopefully unblock you soon!

remi-stripe avatar May 07 '24 19:05 remi-stripe

We've merged this in master and should be part of the next release tomorrow.

prathmesh-stripe avatar May 08 '24 21:05 prathmesh-stripe