2021-04-21 17:38:06 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-05-04 18:17:50 +02:00
|
|
|
json.invoices @invoices do |invoice|
|
2021-04-21 17:38:06 +02:00
|
|
|
json.extract! invoice, :id, :invoiced_id, :user_id, :invoiced_type, :reference, :total, :type, :description
|
|
|
|
if invoice.payment_gateway_object
|
|
|
|
json.payment_gateway_object do
|
|
|
|
json.id invoice.payment_gateway_object.gateway_object_id
|
|
|
|
json.type invoice.payment_gateway_object.gateway_object_type
|
|
|
|
end
|
|
|
|
end
|
2016-05-04 18:17:50 +02:00
|
|
|
|
|
|
|
json.invoice_url download_open_api_v1_invoice_path(invoice)
|
|
|
|
json.invoiced do
|
|
|
|
json.created_at invoice.invoiced.created_at
|
|
|
|
end
|
|
|
|
end
|