lib/braintree/transaction_gateway.rb in braintree-4.17.0 vs lib/braintree/transaction_gateway.rb in braintree-4.18.0

- old
+ new

@@ -110,10 +110,20 @@ def sale!(*args) return_object_or_raise(:transaction) { sale(*args) } end + def package_tracking(transaction_id, package_tracking_request) + raise ArgumentError, "transaction_id is invalid" unless transaction_id =~ /\A[0-9a-z]+\z/ + Util.verify_keys(TransactionGateway._package_tracking_request_signature, package_tracking_request) + _do_create "/transactions/#{transaction_id}/shipments", :shipment => package_tracking_request + end + + def package_tracking!(*args) + return_object_or_raise(:transaction) { package_tracking(*args) } + end + def search(&block) search = TransactionSearch.new block.call(search) if block response = @config.http.post("#{@config.base_merchant_path}/transactions/advanced_search_ids", {:search => search.to_hash}) @@ -185,10 +195,18 @@ def void!(*args) return_object_or_raise(:transaction) { void(*args) } end + def self._package_tracking_request_signature + [ + :carrier, + {:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]}, + :notify_payer, :tracking_number, + ] + end + def self._clone_signature [:amount, :channel, {:options => [:submit_for_settlement]}] end # NEXT_MAJOR_VERSION Remove venmo_sdk_payment_method_code, venmo_sdk_session, and three_d_secure_token @@ -202,11 +220,11 @@ :shared_customer_id, :shared_payment_method_nonce, :shared_payment_method_token, :shared_shipping_address_id, :shipping_address_id, :shipping_amount, :ships_from_postal_code, :tax_amount, :tax_exempt, :three_d_secure_authentication_id,:three_d_secure_token, #Deprecated :transaction_source, :type, :venmo_sdk_payment_method_code, # Deprecated :sca_exemption, :currency_iso_code, :exchange_rate_quote_id, - {:line_items => [:quantity, :name, :description, :kind, :unit_amount, :unit_tax_amount, :total_amount, :discount_amount, :tax_amount, :unit_of_measure, :product_code, :commodity_code, :url]}, + {:line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url]}, {:risk_data => [:customer_browser, :customer_device_id, :customer_ip, :customer_location_zip, :customer_tenure]}, {:credit_card => [:token, :cardholder_name, :cvv, :expiration_date, :expiration_month, :expiration_year, :number, {:payment_reader_card_details => [:encrypted_card_data, :key_serial_number]}, {:network_tokenization_attributes => [:cryptogram, :ecommerce_indicator, :token_requestor_id]}]}, {:customer => [:id, :company, :email, :fax, :first_name, :last_name, :phone, :website]}, { :billing => AddressGateway._shared_signature @@ -242,11 +260,11 @@ {:paypal => [:custom_field, :payee_id, :payee_email, :description, {:supplementary_data => :_any_key_}]}, {:processing_overrides => [:customer_email, :customer_first_name, :customer_last_name, :customer_tax_identifier]}, {:three_d_secure => [:required]}, {:amex_rewards => [:request_id, :points, :currency_amount, :currency_iso_code]}, {:venmo => [:profile_id]}, - {:credit_card => [:account_type]}, + {:credit_card => [:account_type, :process_debit_as_credit]}, ] }, {:external_vault => [ :status, :previous_network_transaction_id, @@ -298,10 +316,10 @@ :tax_amount, :tax_exempt, :discount_amount, :shipping_amount, :ships_from_postal_code, - :line_items => [:commodity_code, :description, :discount_amount, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :url, :tax_amount], + :line_items => [:commodity_code, :description, :discount_amount, :image_url, :kind, :name, :product_code, :quantity, :tax_amount, :total_amount, :unit_amount, :unit_of_measure, :unit_tax_amount, :upc_code, :upc_type, :url], ] end def self._adjust_authorization_signature [