mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
17 lines
471 B
Ruby
17 lines
471 B
Ruby
module Api
|
|
module Admin
|
|
class PaymentMethodSerializer < ActiveModel::Serializer
|
|
delegate :serializable_hash, to: :method_serializer
|
|
|
|
def method_serializer
|
|
if object.type == 'Spree::Gateway::StripeConnect' ||
|
|
object.type == 'Spree::Gateway::StripeSCA'
|
|
Api::Admin::PaymentMethod::StripeSerializer.new(object)
|
|
else
|
|
Api::Admin::PaymentMethod::BaseSerializer.new(object)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|