lib/active_merchant/billing/gateways/netbanx.rb in activemerchant-1.118.0 vs lib/active_merchant/billing/gateways/netbanx.rb in activemerchant-1.119.0

- old
+ new

@@ -34,10 +34,11 @@ post = {} add_invoice(post, money, options) add_settle_with_auth(post) add_payment(post, payment, options) + add_customer_detail_data(post, options) commit(:post, 'auths', post) end def authorize(money, payment, options = {}) @@ -46,10 +47,11 @@ return verification_response if verification_response.message != 'OK' post = {} add_invoice(post, money, options) add_payment(post, payment, options) + add_customer_detail_data(post, options) commit(:post, 'auths', post) end def capture(money, authorization, options = {}) @@ -143,9 +145,18 @@ end def add_customer_data(post, options) post[:merchantCustomerId] = (options[:merchant_customer_id] || SecureRandom.uuid) post[:locale] = options[:locale] + end + + def add_customer_detail_data(post, options) + post[:profile] ||= {} + post[:profile][:email] = options[:email] if options[:email] + post[:customerIp] = options[:ip] if options[:ip] + if (billing_address = options[:billing_address]) + post[:profile][:firstName], post[:profile][:lastName] = split_names(billing_address[:name]) + end end def add_credit_card(post, credit_card, options = {}) post[:card] ||= {} post[:card][:cardNum] = credit_card.number