diff --git a/app/controllers/registration_controller.rb b/app/controllers/registration_controller.rb index 82d3fc06..389ff23a 100644 --- a/app/controllers/registration_controller.rb +++ b/app/controllers/registration_controller.rb @@ -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, @@ -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, diff --git a/lib/competition_info.rb b/lib/competition_info.rb index 47b944f0..301c2c7b 100644 --- a/lib/competition_info.rb +++ b/lib/competition_info.rb @@ -45,7 +45,7 @@ def guest_limit end def registration_open? - @competition_json['registration_open'] <= Time.now && @competition_json['registration_close'] > Time.now + @competition_json['registration_open'] <= Time.now.utc && @competition_json['registration_close'] > Time.now.utc end def using_wca_payment?