lib/braintree/transaction_gateway.rb in braintree-2.62.0 vs lib/braintree/transaction_gateway.rb in braintree-2.63.0

- old
+ new

@@ -59,12 +59,19 @@ Transaction._new(@gateway, response[:transaction]) rescue NotFoundError raise NotFoundError, "transaction with id #{id.inspect} not found" end - def refund(transaction_id, amount = nil) - response = @config.http.post("#{@config.base_merchant_path}/transactions/#{transaction_id}/refund", :transaction => {:amount => amount}) + def refund(transaction_id, amount_or_options = nil) + options = if amount_or_options.is_a?(Hash) + amount_or_options + else + { :amount => amount_or_options } + end + + Util.verify_keys(TransactionGateway._refund_signature, options) + response = @config.http.post("#{@config.base_merchant_path}/transactions/#{transaction_id}/refund", :transaction => options) _handle_transaction_response(response) end def retry_subscription_charge(subscription_id, amount=nil) attributes = { @@ -144,10 +151,17 @@ :billing => AddressGateway._shared_signature }, { :shipping => AddressGateway._shared_signature }, + { + :three_d_secure_pass_thru => [ + :eci_flag, + :cavv, + :xid, + ] + }, {:options => [ :hold_in_escrow, :store_in_vault, :store_in_vault_on_success, :submit_for_settlement, @@ -180,9 +194,16 @@ def self._update_details_signature # :nodoc: [ :amount, :order_id, {:descriptor => [:name, :phone, :url]}, + ] + end + + def self._refund_signature + [ + :amount, + :order_id ] end def _do_create(path, params=nil) # :nodoc: response = @config.http.post("#{@config.base_merchant_path}#{path}", params)