lib/braintree/transaction_gateway.rb in braintree-2.54.0 vs lib/braintree/transaction_gateway.rb in braintree-2.55.0

- old
+ new

@@ -96,13 +96,15 @@ raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/ response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/release_from_escrow") _handle_transaction_response(response) end - def submit_for_settlement(transaction_id, amount = nil) + def submit_for_settlement(transaction_id, amount = nil, options = {}) raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/ - response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/submit_for_settlement", :transaction => {:amount => amount}) + Util.verify_keys(TransactionGateway._submit_for_settlement_signature, options) + transaction_params = {:amount => amount}.merge(options) + response = @config.http.put("#{@config.base_merchant_path}/transactions/#{transaction_id}/submit_for_settlement", :transaction => transaction_params) _handle_transaction_response(response) end def submit_for_partial_settlement(authorized_transaction_id, amount = nil) raise ArgumentError, "authorized_transaction_id is invalid" unless authorized_transaction_id =~ /\A[0-9a-z]+\z/ @@ -144,18 +146,25 @@ :store_shipping_address_in_vault, :venmo_sdk_session, :payee_email, :skip_avs, :skip_cvv, - {:paypal => [:custom_field, :payee_email, :description]}, + {:paypal => [:custom_field, :payee_email, :description, {:supplementary_data => :_any_key_}]}, {:three_d_secure => [:required]}, {:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]}] }, {:custom_fields => :_any_key_}, {:descriptor => [:name, :phone, :url]}, {:paypal_account => [:email, :token, :paypal_data, :payee_email]}, {:industry => [:industry_type, {:data => [:folio_number, :check_in_date, :check_out_date, :travel_package, :lodging_check_in_date, :lodging_check_out_date, :departure_date, :lodging_name, :room_rate]}]}, {:apple_pay_card => [:number, :cardholder_name, :cryptogram, :expiration_month, :expiration_year]} + ] + end + + def self._submit_for_settlement_signature # :nodoc: + [ + :order_id, + {:descriptor => [:name, :phone, :url]}, ] end def _do_create(path, params=nil) # :nodoc: response = @config.http.post("#{@config.base_merchant_path}#{path}", params)