lib/braintree/transaction.rb in braintree-2.40.0 vs lib/braintree/transaction.rb in braintree-2.41.0
- old
+ new
@@ -1,7 +1,6 @@
module Braintree
- # See http://www.braintreepayments.com/docs/ruby/transactions/overview
class Transaction
include BaseModule
module CreatedUsing
FullInformation = 'full_information'
@@ -114,16 +113,14 @@
attr_reader :updated_at
attr_reader :add_ons, :discounts
attr_reader :payment_instrument_type
attr_reader :risk_data
- # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.create(attributes)
Configuration.gateway.transaction.create(attributes)
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.create!(attributes)
return_object_or_raise(:transaction) { create(attributes) }
end
def self.cancel_release(transaction_id)
@@ -141,20 +138,16 @@
def self.clone_transaction!(transaction_id, attributes)
return_object_or_raise(:transaction) { clone_transaction(transaction_id, attributes) }
end
# Deprecated. Use Braintree::TransparentRedirect.confirm
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/create_tr
def self.create_from_transparent_redirect(query_string)
warn "[DEPRECATED] Transaction.create_from_transparent_redirect is deprecated. Please use TransparentRedirect.confirm"
Configuration.gateway.transaction.create_from_transparent_redirect(query_string)
end
# Deprecated. Use Braintree::TransparentRedirect.url
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/create_tr
def self.create_transaction_url
warn "[DEPRECATED] Transaction.create_transaction_url is deprecated. Please use TransparentRedirect.url"
Configuration.gateway.transaction.create_transaction_url
end
@@ -164,11 +157,10 @@
def self.credit!(attributes)
return_object_or_raise(:transaction) { credit(attributes) }
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/search
def self.find(id)
Configuration.gateway.transaction.find(id)
end
def self.hold_in_escrow(id)
@@ -177,31 +169,26 @@
def self.hold_in_escrow!(id)
return_object_or_raise(:transaction) { hold_in_escrow(id) }
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/refund
def self.refund(id, amount = nil)
Configuration.gateway.transaction.refund(id, amount)
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/refund
def self.refund!(id, amount = nil)
return_object_or_raise(:transaction) { refund(id, amount) }
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.sale(attributes)
Configuration.gateway.transaction.sale(attributes)
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/create
def self.sale!(attributes)
return_object_or_raise(:transaction) { sale(attributes) }
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/search
def self.search(&block)
Configuration.gateway.transaction.search(&block)
end
def self.release_from_escrow(transaction_id)
@@ -210,26 +197,22 @@
def self.release_from_escrow!(transaction_id)
return_object_or_raise(:transaction) { release_from_escrow(transaction_id) }
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def self.submit_for_settlement(transaction_id, amount = nil)
Configuration.gateway.transaction.submit_for_settlement(transaction_id, amount)
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def self.submit_for_settlement!(transaction_id, amount = nil)
return_object_or_raise(:transaction) { submit_for_settlement(transaction_id, amount) }
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/void
def self.void(transaction_id)
Configuration.gateway.transaction.void(transaction_id)
end
- # See http://www.braintreepayments.com/docs/ruby/transactions/void
def self.void!(transaction_id)
return_object_or_raise(:transaction) { void(transaction_id) }
end
def initialize(gateway, attributes) # :nodoc:
@@ -275,12 +258,10 @@
end
"#<#{self.class} #{nice_attributes.join(', ')}>"
end
# Deprecated. Use Braintree::Transaction.refund
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/refund
def refund(amount = nil)
warn "[DEPRECATED] refund as an instance method is deprecated. Please use Transaction.refund"
result = @gateway.transaction.refund(id, amount)
if result.success?
@@ -304,24 +285,20 @@
warn "[DEPRECATED] Transaction.refund_id is deprecated. Please use Transaction.refund_ids"
@refund_id
end
# Deprecated. Use Braintree::Transaction.submit_for_settlement
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def submit_for_settlement(amount = nil)
warn "[DEPRECATED] submit_for_settlement as an instance method is deprecated. Please use Transaction.submit_for_settlement"
result = @gateway.transaction.submit_for_settlement(id, amount)
if result.success?
copy_instance_variables_from_object result.transaction
end
result
end
# Deprecated. Use Braintree::Transaction.submit_for_settlement!
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/submit_for_settlement
def submit_for_settlement!(amount = nil)
warn "[DEPRECATED] submit_for_settlement! as an instance method is deprecated. Please use Transaction.submit_for_settlement!"
return_object_or_raise(:transaction) { submit_for_settlement(amount) }
end
@@ -360,23 +337,19 @@
return nil if shipping_details.id.nil?
@gateway.address.find(customer_details.id, shipping_details.id)
end
# Deprecated. Use Braintree::Transaction.void
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/void
def void
warn "[DEPRECATED] void as an instance method is deprecated. Please use Transaction.void"
result = @gateway.transaction.void(id)
if result.success?
copy_instance_variables_from_object result.transaction
end
result
end
# Deprecated. Use Braintree::Transaction.void!
- #
- # See http://www.braintreepayments.com/docs/ruby/transactions/void
def void!
warn "[DEPRECATED] void! as an instance method is deprecated. Please use Transaction.void!"
return_object_or_raise(:transaction) { void }
end