Add domain renewal with balance deduction

This commit is contained in:
Alex Sherman 2020-12-11 15:43:56 +05:00
parent 729f39f612
commit 7d2aad570e
6 changed files with 83 additions and 18 deletions

View file

@ -16,12 +16,14 @@ class Registrar
if domain_ids_for_bulk_renew.present?
domains = Epp::Domain.where(id: domain_ids_for_bulk_renew).to_a
task = Domains::BulkRenew::Start.run(domains: domains, period_element: @period)
if task.valid?
flash[:notice] = t(:bulk_renew_completed)
else
flash[:notice] = task.errors.full_messages.join(' and ')
end
task = Domains::BulkRenew::Start.run(domains: domains,
period_element: @period,
registrar: current_registrar_user.registrar)
flash[:notice] = if task.valid?
t(:bulk_renew_completed)
else
task.errors.full_messages.join(' and ')
end
end
render file: 'registrar/bulk_change/new', locals: { active_tab: :bulk_renew }
end