stripe / stripe-ruby

Ruby library for the Stripe API.
https://stripe.com
MIT License
1.96k stars 548 forks source link

TaxId objects are failing to delete #1333

Closed tmoore95 closed 8 months ago

tmoore95 commented 8 months ago

Describe the bug

After upgrading to 10.8.0 one of our tests started failing due to an issue with retrieving the customer when deleting a TaxId object. It looks like the tax id itself is being passed in as the customer id in lib/stripe/resources/tax_id.rb:44 in this commit.

To Reproduce

Upgrade to version 10.8.0 of the gem, fetch a TaxId object and then call delete on it.

Expected behavior

It should get deleted, but instead it raises the following error: <Stripe::InvalidRequestError: (Status 404) (Request <request_id>) No such customer: <tax_id>>

Code snippets

def delete(params = {}, opts = {})
  request_stripe_object(
    method: :delete,
    path: format("/v1/customers/%<customer>s/tax_ids/%<id>s", { customer: CGI.escape(self["id"]), id: CGI.escape(id) }),
    params: params,
    opts: opts
  )
end

OS

macOS

Language version

Ruby 3.3.0

Library version

stripe-ruby 10.8.0

API version

2023-10-16

Additional context

No response

helenye-stripe commented 8 months ago

Hi @tmoore95! Thanks for bringing this to our attention. This should be fixed in #1329 and will be included in this week's release.

tmoore95 commented 8 months ago

Hi @tmoore95! Thanks for bringing this to our attention. This should be fixed in #1329 and will be included in this week's release.

Great, thanks for the swift response!

helenye-stripe commented 8 months ago

Thanks again for bringing this up! This should be fixed as of v10.9.0.