lib/balanced/resources/card.rb in balanced-0.3.11 vs lib/balanced/resources/card.rb in balanced-0.5.1
- old
+ new
@@ -18,28 +18,41 @@
# If +appears_on_statement_as+ is nil, then Balanced will use the
# +domain_name+ property from your Marketplace.
#
# @return [Debit]
def debit *args
+ warn_on_positional args
options = args.last.is_a?(Hash) ? args.pop : {}
amount = args[0] || options.fetch(:amount) { nil }
appears_on_statement_as = args[1] || options.fetch(:appears_on_statement_as) { nil }
- holds_uri = args[2] || options.fetch(:holds_uri) { nil }
+ hold_uri = args[2] || options.fetch(:hold_uri) { nil }
meta = args[3] || options.fetch(:meta) { nil }
description = args[3] || options.fetch(:description) { nil }
- self.account.debit(amount, appears_on_statement_as, holds_uri, meta, description, self.uri)
+ self.account.debit(
+ :amount => amount,
+ :appears_on_statement_as => appears_on_statement_as,
+ :hold_uri => hold_uri,
+ :meta => meta,
+ :description => description,
+ :source_uri => self.uri
+ )
end
# Creates a Hold of funds from this Card to your Marketplace.
#
# @return [Hold]
def hold *args
+ warn_on_positional args
options = args.last.is_a?(Hash) ? args.pop : {}
amount = args[0] || options.fetch(:amount) { nil }
- meta = args[3] || options.fetch(:meta) { nil }
+ meta = args[1] || options.fetch(:meta) { nil }
- self.account.hold(amount, meta, self.uri)
+ self.account.hold(
+ :amount => amount,
+ :meta => meta,
+ :source_uri => self.uri
+ )
end
def invalidate
self.is_valid = false
save