lib/stripe/customer.rb in stripe-1.51.1 vs lib/stripe/customer.rb in stripe-1.52.0
- old
+ new
@@ -3,25 +3,10 @@
extend Stripe::APIOperations::Create
include Stripe::APIOperations::Delete
include Stripe::APIOperations::Save
extend Stripe::APIOperations::List
- # Set or replace a customer's default source.
- def source=(value)
- super
-
- # The parent setter will perform certain useful operations like
- # converting to an APIResource if appropriate.
- value = self.source
-
- # Note that source may be a card, but could also be a tokenized card's ID
- # (which is a string), and so we check its type here.
- if value.is_a?(APIResource)
- value.save_with_parent = true
- end
-
- value
- end
+ save_nested_resource :source
def add_invoice_item(params, opts={})
opts = @opts.merge(Util.normalize_opts(opts))
InvoiceItem.create(params.merge(:customer => id), opts)
end