lib/active_merchant/billing/gateways/optimal_payment.rb in activemerchant-1.49.0 vs lib/active_merchant/billing/gateways/optimal_payment.rb in activemerchant-1.50.0
- old
+ new
@@ -267,21 +267,23 @@
end
def build_billing_details(xml, opts)
xml.tag! 'billingDetails' do
xml.tag! 'cardPayMethod', 'WEB'
- build_address(xml, opts[:billing_address], opts[:email])
+ build_address(xml, opts[:billing_address]) if opts[:billing_address]
+ xml.tag! 'email', opts[:email] if opts[:email]
end
end
def build_shipping_details(xml, opts)
xml.tag! 'shippingDetails' do
- build_address(xml, opts[:shipping_address], opts[:email])
+ build_address(xml, opts[:shipping_address])
+ xml.tag! 'email', opts[:email] if opts[:email]
end if opts[:shipping_address].present?
end
- def build_address(xml, addr, email=nil)
+ def build_address(xml, addr)
if addr[:name]
xml.tag! 'firstName', addr[:name].split(' ').first
xml.tag! 'lastName' , addr[:name].split(' ').last
end
xml.tag! 'street' , addr[:address1] if addr[:address1].present?
@@ -292,10 +294,9 @@
xml.tag! state_tag, addr[:state]
end
xml.tag! 'country', addr[:country] if addr[:country].present?
xml.tag! 'zip' , addr[:zip] if addr[:zip].present?
xml.tag! 'phone' , addr[:phone] if addr[:phone].present?
- xml.tag! 'email', email if email
end
def card_type(key)
{ 'visa' => 'VI',
'master' => 'MC',