lib/stripe/resources/tax_id.rb in stripe-10.9.0.pre.beta.1 vs lib/stripe/resources/tax_id.rb in stripe-10.9.0
- old
+ new
@@ -8,10 +8,13 @@
# Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids)
class TaxId < APIResource
include Stripe::APIOperations::Delete
OBJECT_NAME = "tax_id"
+ def self.object_name
+ "tax_id"
+ end
def resource_url
if !respond_to?(:customer) || customer.nil?
raise NotImplementedError,
"Tax IDs cannot be accessed without a customer ID."
@@ -25,24 +28,22 @@
"Tax IDs cannot be retrieved without a customer ID. Retrieve a " \
"tax ID using `Customer.retrieve_tax_id('customer_id', " \
"'tax_id_id')`"
end
- # Deletes an existing tax_id object.
def self.delete(id, params = {}, opts = {})
request_stripe_object(
method: :delete,
- path: format("/v1/customers/%<customer>s/tax_ids/%<id>s", { customer: CGI.escape(customer), id: CGI.escape(id) }),
+ path: "#{resource_url}/#{id}",
params: params,
opts: opts
)
end
- # Deletes an existing tax_id object.
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) }),
+ path: resource_url.to_s,
params: params,
opts: opts
)
end
end