lib/stripe/customer.rb in stripe-3.5.3 vs lib/stripe/customer.rb in stripe-3.6.0
- old
+ new
@@ -2,13 +2,21 @@
class Customer < APIResource
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete
include Stripe::APIOperations::Save
extend Stripe::APIOperations::List
+ extend Stripe::APIOperations::NestedResource
OBJECT_NAME = "customer".freeze
save_nested_resource :source
+ nested_resource_class_methods :source
+
+ # The API request for deleting a card or bank account and for detaching a
+ # source object are the same.
+ class << self
+ alias detach_source delete_source
+ end
def add_invoice_item(params, opts = {})
opts = @opts.merge(Util.normalize_opts(opts))
InvoiceItem.create(params.merge(customer: id), opts)
end