lib/active_merchant/billing/gateways/mercado_pago.rb in activemerchant-1.121.0 vs lib/active_merchant/billing/gateways/mercado_pago.rb in activemerchant-1.123.0

- old
+ new

@@ -127,10 +127,11 @@ post[:merchant_services] = merchant_services end def add_additional_data(post, options) post[:sponsor_id] = options[:sponsor_id] + post[:metadata] = options[:metadata] if options[:metadata] post[:device_id] = options[:device_id] if options[:device_id] post[:additional_info] = { ip_address: options[:ip_address] }.merge(options[:additional_info] || {}) @@ -141,11 +142,11 @@ def add_customer_data(post, payment, options) post[:payer] = { email: options[:email], first_name: payment.first_name, last_name: payment.last_name - } + }.merge(options[:payer] || {}) end def add_address(post, options) if address = (options[:billing_address] || options[:address]) @@ -189,10 +190,10 @@ def add_invoice(post, money, options) post[:transaction_amount] = amount(money).to_f post[:description] = options[:description] post[:installments] = options[:installments] ? options[:installments].to_i : 1 post[:statement_descriptor] = options[:statement_descriptor] if options[:statement_descriptor] - post[:external_reference] = options[:order_id] || SecureRandom.hex(16) + post[:external_reference] = options[:order_id] || options[:external_reference] || SecureRandom.hex(16) end def add_payment(post, options) post[:token] = options[:card_token] post[:issuer_id] = options[:issuer_id] if options[:issuer_id]