lib/active_merchant/billing/gateways/conekta.rb in activemerchant-1.103.0 vs lib/active_merchant/billing/gateways/conekta.rb in activemerchant-1.104.0
- old
+ new
@@ -103,11 +103,11 @@
add_shipment_address(shipment, options)
post[:shipment] = shipment
end
def add_shipment_address(post, options)
- if(address = options[:shipping_address])
+ if (address = options[:shipping_address])
post[:address] = {}
post[:address][:street1] = address[:address1] if address[:address1]
post[:address][:street2] = address[:address2] if address[:address2]
post[:address][:street3] = address[:address3] if address[:address3]
post[:address][:city] = address[:city] if address[:city]
@@ -122,11 +122,11 @@
line_item
end
end
def add_billing_address(post, options)
- if(address = (options[:billing_address] || options[:address]))
+ if (address = (options[:billing_address] || options[:address]))
post[:billing_address] = {}
post[:billing_address][:street1] = address[:address1] if address[:address1]
post[:billing_address][:street2] = address[:address2] if address[:address2]
post[:billing_address][:street3] = address[:address3] if address[:address3]
post[:billing_address][:city] = address[:city] if address[:city]
@@ -140,11 +140,11 @@
post[:billing_address][:email] = address[:email] if address[:email]
end
end
def add_address(post, options)
- if(address = (options[:billing_address] || options[:address]))
+ if (address = (options[:billing_address] || options[:address]))
post[:address] = {}
post[:address][:street1] = address[:address1] if address[:address1]
post[:address][:street2] = address[:address2] if address[:address2]
post[:address][:street3] = address[:address3] if address[:address3]
post[:address][:city] = address[:city] if address[:city]
@@ -168,10 +168,11 @@
end
end
def parse(body)
return {} unless body
+
JSON.parse(body)
end
def headers(options)
{
@@ -185,9 +186,10 @@
}
end
def conekta_client_user_agent(options)
return user_agent unless options[:application]
+
JSON.dump(JSON.parse(user_agent).merge!({application: options[:application]}))
end
def commit(method, url, parameters, options = {})
success = false