lib/active_merchant/billing/gateways/openpay.rb in activemerchant-1.79.2 vs lib/active_merchant/billing/gateways/openpay.rb in activemerchant-1.80.0
- old
+ new
@@ -36,10 +36,11 @@
end
def capture(money, authorization, options = {})
post = {}
post[:amount] = amount(money) if money
+ post[:payments] = options[:payments] if options[:payments]
commit(:post, "charges/#{CGI.escape(authorization)}/capture", post, options)
end
def void(identification, options = {})
commit(:post, "charges/#{CGI.escape(identification)}/refund", nil, options)
@@ -112,10 +113,11 @@
post[:description] = options[:description]
post[:order_id] = options[:order_id]
post[:device_session_id] = options[:device_session_id]
post[:currency] = (options[:currency] || currency(money)).upcase
post[:use_card_points] = options[:use_card_points] if options[:use_card_points]
+ post[:payment_plan] = {payments: options[:payments]} if options[:payments]
add_creditcard(post, creditcard, options)
post
end
def add_creditcard(post, creditcard, options)
@@ -161,13 +163,13 @@
end
end
def headers(options = {})
{
- "Content-Type" => "application/json",
- "Authorization" => "Basic " + Base64.strict_encode64(@api_key.to_s + ":").strip,
- "User-Agent" => "Openpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
- "X-Openpay-Client-User-Agent" => user_agent
+ 'Content-Type' => 'application/json',
+ 'Authorization' => 'Basic ' + Base64.strict_encode64(@api_key.to_s + ':').strip,
+ 'User-Agent' => "Openpay/v1 ActiveMerchantBindings/#{ActiveMerchant::VERSION}",
+ 'X-Openpay-Client-User-Agent' => user_agent
}
end
def parse(body)
return {} unless body