1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-02-20 14:54:15 +01:00
fab-manager/app/views/api/payment_schedules/_payment_schedule.json.jbuilder
Sylvain aaf36dcc0a reserve events w/ payzen
we cannot use the <cart> directive because the layout is too much different
2021-04-29 16:29:35 +02:00

21 lines
830 B
Ruby

# frozen_string_literal: true
json.extract! payment_schedule, :id, :reference, :created_at, :payment_method
json.total payment_schedule.total / 100.00
json.chained_footprint payment_schedule.check_footprint
json.user do
json.id payment_schedule.invoicing_profile&.user&.id
json.name payment_schedule.invoicing_profile.full_name
end
if payment_schedule.operator_profile
json.operator do
json.id payment_schedule.operator_profile.user_id
json.extract! payment_schedule.operator_profile, :first_name, :last_name
end
end
json.items payment_schedule.payment_schedule_items do |item|
json.extract! item, :id, :due_date, :state, :invoice_id, :payment_method
json.amount item.amount / 100.00
json.client_secret item.payment_intent.client_secret if item.payment_gateway_object && item.state == 'requires_action'
end