lib/active_merchant/billing/gateways/merchant_partners.rb in activemerchant-1.114.0 vs lib/active_merchant/billing/gateways/merchant_partners.rb in activemerchant-1.116.0
- old
+ new
@@ -11,67 +11,67 @@
self.supported_countries = ['US']
self.default_currency = 'USD'
self.money_format = :dollars
self.supported_cardtypes = %i[visa master american_express discover diners_club jcb]
- def initialize(options={})
+ def initialize(options = {})
requires!(options, :account_id, :merchant_pin)
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)
add_customer_data(post, options)
commit(payment_method.is_a?(String) ? :stored_purchase : :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)
add_customer_data(post, options)
commit(:authorize, post)
end
- def capture(amount, authorization, options={})
+ def capture(amount, authorization, options = {})
post = {}
add_invoice(post, amount, options)
add_reference(post, authorization)
add_customer_data(post, 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_invoice(post, amount, options)
add_reference(post, authorization)
add_customer_data(post, options)
commit(:refund, post)
end
- def credit(amount, payment_method, options={})
+ def credit(amount, payment_method, options = {})
post = {}
add_invoice(post, amount, options)
add_payment_method(post, payment_method)
commit(payment_method.is_a?(String) ? :stored_credit : :credit, post)
end
- def verify(credit_card, options={})
+ def verify(credit_card, options = {})
MultiResponse.run(:use_first_response) do |r|
r.process { authorize(100, credit_card, options) }
r.process(:ignore_result) { void(r.authorization, options) }
end
end
@@ -109,12 +109,12 @@
post[:currency] = options[:currency] || currency(money)
end
def add_payment_method(post, payment_method)
if payment_method.is_a?(String)
- user_profile_id, last_4 = split_authorization(payment_method)
+ user_profile_id, last4 = split_authorization(payment_method)
post[:userprofileid] = user_profile_id
- post[:last4digits] = last_4
+ post[:last4digits] = last4
else
post[:ccname] = payment_method.name
post[:ccnum] = payment_method.number
post[:cvv2] = payment_method.verification_value
post[:expmon] = format(payment_method.month, :two_digits)