lib/active_merchant/billing/gateways/quickbooks.rb in activemerchant-1.75.0 vs lib/active_merchant/billing/gateways/quickbooks.rb in activemerchant-1.76.0

- old
+ new

@@ -76,17 +76,19 @@ def capture(money, authorization, options = {}) post = {} capture_uri = "#{ENDPOINT}/#{CGI.escape(authorization)}/capture" post[:amount] = localized_amount(money, currency(money)) + add_context(post, options) commit(capture_uri, post) end def refund(money, authorization, options = {}) post = {} post[:amount] = localized_amount(money, currency(money)) + add_context(post, options) commit(refund_uri(authorization), post) end def verify(credit_card, options = {}) @@ -135,10 +137,11 @@ post[:currency] = currency.upcase end def add_payment(post, payment, options = {}) add_creditcard(post, payment, options) + add_context(post, options) end def add_creditcard(post, creditcard, options = {}) card = {} card[:number] = creditcard.number @@ -147,9 +150,16 @@ card[:cvc] = creditcard.verification_value if creditcard.verification_value? card[:name] = creditcard.name if creditcard.name card[:commercialCardCode] = options[:card_code] if options[:card_code] post[:card] = card + end + + def add_context(post, options = {}) + post[:context] = { + mobile: options.fetch(:mobile, false), + isEcommerce: options.fetch(:ecommerce, true) + } end def parse(body) JSON.parse(body) end