lib/active_merchant/billing/gateways/micropayment.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/micropayment.rb in activemerchant-1.116.0
- old
+ new
@@ -9,54 +9,54 @@
self.supported_countries = %w(DE)
self.default_currency = 'EUR'
self.money_format = :cents
self.supported_cardtypes = %i[visa master american_express]
- def initialize(options={})
+ def initialize(options = {})
requires!(options, :access_key)
super
end
- def purchase(amount, payment_method, options={})
+ def purchase(amount, payment_method, options = {})
post = {}
add_invoice(post, amount, options)
add_payment_method(post, payment_method, options)
add_customer_data(post, options)
add_address(post, options)
commit('purchase', post)
end
- def authorize(amount, payment_method, options={})
+ def authorize(amount, payment_method, options = {})
post = {}
add_invoice(post, amount, options)
add_payment_method(post, payment_method, options)
add_customer_data(post, options)
add_address(post, options)
commit('authorize', post)
end
- def capture(amount, authorization, options={})
+ def capture(amount, authorization, options = {})
post = {}
add_reference(post, authorization)
add_invoice(post, amount, options)
commit('capture', post)
end
- def void(authorization, options={})
+ def void(authorization, options = {})
post = {}
add_reference(post, authorization)
commit('void', post)
end
- def refund(amount, authorization, options={})
+ def refund(amount, authorization, options = {})
post = {}
add_reference(post, authorization)
add_invoice(post, amount, options)
commit('refund', post)
end
- def verify(credit_card, options={})
+ def verify(credit_card, options = {})
MultiResponse.run(:use_first_response) do |r|
r.process { authorize(250, credit_card, options) }
r.process(:ignore_result) { void(r.authorization, options) }
end
end
@@ -81,10 +81,10 @@
end
post[:project] = options[:project] if options[:project]
post['params[title]'] = options[:description] if options[:description]
end
- def add_payment_method(post, payment_method, options={})
+ def add_payment_method(post, payment_method, options = {})
post[:number] = payment_method.number
post[:recurring] = 1 if options[:recurring] == true
post[:cvc2] = payment_method.verification_value
post[:expiryYear] = format(payment_method.year, :four_digits)
post[:expiryMonth] = format(payment_method.month, :two_digits)