lib/active_merchant/billing/gateways/paymentez.rb in activemerchant-1.89.0 vs lib/active_merchant/billing/gateways/paymentez.rb in activemerchant-1.90.0

- old
+ new

@@ -50,10 +50,11 @@ post = {} add_invoice(post, money, options) add_payment(post, payment) add_customer_data(post, options) + add_extra_params(post, options) action = payment.is_a?(String) ? 'debit' : 'debit_cc' commit_transaction(action, post) end @@ -61,10 +62,11 @@ post = {} add_invoice(post, money, options) add_payment(post, payment) add_customer_data(post, options) + add_extra_params(post, options) commit_transaction('authorize', post) end def capture(money, authorization, _options = {}) @@ -163,9 +165,21 @@ post[:card][:holder_name] = payment.name post[:card][:expiry_month] = payment.month post[:card][:expiry_year] = payment.year post[:card][:cvc] = payment.verification_value post[:card][:type] = CARD_MAPPING[payment.brand] + end + end + + def add_extra_params(post, options) + if options[:extra_params] + items = {} + options[:extra_params].each do |param| + param.each do |key, value| + items[key.to_sym] = value + end + end + post[:extra_params] = items end end def parse(body) JSON.parse(body)