lib/active_merchant/billing/gateways/clearhaus.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/clearhaus.rb in activemerchant-1.116.0
- old
+ new
@@ -34,24 +34,24 @@
40414 => 'Suspected fraud',
40415 => 'Amount limit exceeded',
50000 => 'Clearhaus error'
}
- def initialize(options={})
+ def initialize(options = {})
requires!(options, :api_key)
options[:private_key] = options[:private_key].strip if options[:private_key]
super
end
- def purchase(amount, payment, options={})
+ def purchase(amount, payment, options = {})
MultiResponse.run(:use_first_response) do |r|
r.process { authorize(amount, payment, options) }
r.process { capture(amount, r.authorization, options) }
end
end
- def authorize(amount, payment, options={})
+ def authorize(amount, payment, options = {})
post = {}
add_invoice(post, amount, options)
action =
if payment.respond_to?(:number)
@@ -67,35 +67,35 @@
post[:card][:pares] = options[:pares] if options[:pares]
commit(action, post)
end
- def capture(amount, authorization, options={})
+ def capture(amount, authorization, options = {})
post = {}
add_invoice(post, amount, options)
commit("/authorizations/#{authorization}/captures", post)
end
- def refund(amount, authorization, options={})
+ def refund(amount, authorization, options = {})
post = {}
add_amount(post, amount, options)
commit("/authorizations/#{authorization}/refunds", post)
end
def void(authorization, options = {})
commit("/authorizations/#{authorization}/voids", options)
end
- def verify(credit_card, options={})
+ def verify(credit_card, options = {})
MultiResponse.run(:use_first_response) do |r|
r.process { authorize(0, credit_card, options) }
r.process(:ignore_result) { void(r.authorization, options) }
end
end
- def store(credit_card, options={})
+ def store(credit_card, options = {})
post = {}
add_payment(post, credit_card)
commit('/cards', post)
end