lib/active_merchant/billing/gateways/openpay.rb in activemerchant-1.67.0 vs lib/active_merchant/billing/gateways/openpay.rb in activemerchant-1.68.0

- old
+ new

@@ -128,11 +128,23 @@ expiration_year: "#{"#{creditcard.year}"[-2, 2]}", cvv2: creditcard.verification_value, holder_name: creditcard.name } add_address(card, options) + add_customer_data(post, creditcard, options) post[:card] = card end + end + + def add_customer_data(post, creditcard, options) + if options[:email] + customer = { + name: creditcard.name || options[:name], + email: options[:email] + } + post[:customer] = customer + end + post end def add_address(card, options) return unless card.kind_of?(Hash) if address = (options[:billing_address] || options[:address])