Files
openfoodnetwork/app/serializers/api/customer_serializer.rb
2020-12-08 07:52:42 -08:00

15 lines
434 B
Ruby

module Api
class CustomerSerializer < ActiveModel::Serializer
attributes :id, :enterprise_id, :name, :code, :email, :allow_charges
def attributes
hash = super
if secret = object.gateway_recurring_payment_client_secret
hash.merge!(gateway_recurring_payment_client_secret: secret)
end
hash.merge!(gateway_shop_id: object.gateway_shop_id) if object.gateway_shop_id
hash
end
end
end