lib/braintree/credit_card.rb in braintree-4.19.0 vs lib/braintree/credit_card.rb in braintree-4.20.0

- old
+ new

@@ -79,15 +79,21 @@ def self.create!(*args) Configuration.gateway.credit_card.create!(*args) end + # NEXT_MAJOR_VERSION remove this method + # CreditCard.credit has been deprecated in favor of Transaction.credit def self.credit(token, transaction_attributes) + warn "[DEPRECATED] CreditCard.credit is deprecated. Use Transaction.credit instead" Transaction.credit(transaction_attributes.merge(:payment_method_token => token)) end + # NEXT_MAJOR_VERSION remove this method + # CreditCard.credit has been deprecated in favor of Transaction.credit def self.credit!(token, transaction_attributes) + warn "[DEPRECATED] CreditCard.credit is deprecated. Use Transaction.credit instead" return_object_or_raise(:transaction) { credit(token, transaction_attributes) } end def self.delete(*args) Configuration.gateway.credit_card.delete(*args) @@ -107,14 +113,20 @@ def self.from_nonce(*args) Configuration.gateway.credit_card.from_nonce(*args) end + # NEXT_MAJOR_VERSION remove this method + # CreditCard.sale has been deprecated in favor of Transaction.sale def self.sale(token, transaction_attributes) + warn "[DEPRECATED] CreditCard.sale is deprecated. Use Transaction.sale instead" Configuration.gateway.transaction.sale(transaction_attributes.merge(:payment_method_token => token)) end + # NEXT_MAJOR_VERSION remove this method + # CreditCard.sale has been deprecated in favor of Transaction.sale def self.sale!(token, transaction_attributes) + warn "[DEPRECATED] CreditCard.sale is deprecated. Use Transaction.sale instead" return_object_or_raise(:transaction) { sale(token, transaction_attributes) } end def self.update(*args) Configuration.gateway.credit_card.update(*args)