lib/active_merchant/billing/gateways/ebanx.rb in activemerchant-1.108.0 vs lib/active_merchant/billing/gateways/ebanx.rb in activemerchant-1.109.0
- old
+ new
@@ -4,11 +4,11 @@
self.test_url = 'https://sandbox.ebanxpay.com/ws/'
self.live_url = 'https://api.ebanxpay.com/ws/'
self.supported_countries = %w(BR MX CO CL AR PE)
self.default_currency = 'USD'
- self.supported_cardtypes = [:visa, :master, :american_express, :discover, :diners_club]
+ self.supported_cardtypes = %i[visa master american_express discover diners_club]
self.homepage_url = 'http://www.ebanx.com/'
self.display_name = 'EBANX'
CARD_BRAND = {
@@ -235,11 +235,11 @@
error_code: error_code_from(response, success)
)
end
def success_from(action, response)
- if [:purchase, :capture, :refund].include?(action)
+ if %i[purchase capture refund].include?(action)
response.try(:[], 'payment').try(:[], 'status') == 'CO'
elsif action == :authorize
response.try(:[], 'payment').try(:[], 'status') == 'PE'
elsif action == :void
response.try(:[], 'payment').try(:[], 'status') == 'CA'
@@ -256,11 +256,11 @@
response.try(:[], 'payment').try(:[], 'transaction_status').try(:[], 'description')
end
def authorization_from(action, parameters, response)
if action == :store
- "#{response.try(:[], "token")}|#{CARD_BRAND[parameters[:payment_type_code].to_sym]}"
+ "#{response.try(:[], 'token')}|#{CARD_BRAND[parameters[:payment_type_code].to_sym]}"
else
response.try(:[], 'payment').try(:[], 'hash')
end
end
@@ -276,10 +276,10 @@
"#{hostname}#{URL_MAP[action]}"
end
def requires_http_get(action)
- return true if [:capture, :void].include?(action)
+ return true if %i[capture void].include?(action)
false
end
def convert_to_url_form_encoded(parameters)