Fix rubocop issues

This commit is contained in:
Rob Harrington
2017-09-13 17:27:02 +10:00
parent 1cd1e9dc37
commit 098afc62c1
3 changed files with 13 additions and 9 deletions

View File

@@ -30,7 +30,7 @@ module Spree
flash[:error] = I18n.t(:card_could_not_be_removed)
end
redirect_to account_path(anchor: 'cards')
rescue Stripe::CardError => e
rescue Stripe::CardError
flash[:error] = I18n.t(:card_could_not_be_removed)
redirect_to account_path(anchor: 'cards')
end

View File

@@ -35,7 +35,7 @@ module Spree
provider.purchase(*options_for_purchase_or_auth(money, creditcard, gateway_options))
end
def void(response_code, creditcard, gateway_options)
def void(response_code, _creditcard, gateway_options)
gateway_options[:stripe_account] = stripe_account_id
provider.void(response_code, gateway_options)
end

View File

@@ -1,11 +1,15 @@
class Api::Admin::PaymentMethodSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :method_serializer
module Api
module Admin
class PaymentMethodSerializer < ActiveModel::Serializer
delegate :serializable_hash, to: :method_serializer
def method_serializer
if object.type == 'Spree::Gateway::StripeConnect'
Api::Admin::PaymentMethod::StripeSerializer.new(object)
else
Api::Admin::PaymentMethod::BaseSerializer.new(object)
def method_serializer
if object.type == 'Spree::Gateway::StripeConnect'
Api::Admin::PaymentMethod::StripeSerializer.new(object)
else
Api::Admin::PaymentMethod::BaseSerializer.new(object)
end
end
end
end
end