Skip to content

Commit

Permalink
Add has_paid and payment_statuses in payload (#717)
Browse files Browse the repository at this point in the history
* V2 -> V3 migration payload

* rubocop
  • Loading branch information
FinnIckler authored Nov 4, 2024
1 parent fec6e54 commit 880ed96
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/controllers/registration_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ def get_registrations(competition_id, only_attending: false)
end
else
Registration.where(competition_id: competition_id).all.map do |x|
payment_status = x.payment_status
{ user_id: x['user_id'],
competing: {
event_ids: x.event_ids,
Expand All @@ -313,7 +314,9 @@ def get_registrations(competition_id, only_attending: false)
admin_comment: x.admin_comment,
},
payment: {
payment_status: x.payment_status,
payment_status: payment_status,
payment_statuses: [payment_status],
has_paid: payment_status == 'succeeded',
payment_amount_iso: x.payment_amount,
payment_amount_human_readable: x.payment_amount_human_readable,
updated_at: x.payment_date,
Expand Down

0 comments on commit 880ed96

Please sign in to comment.