mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 02:35:57 +02:00
REPP: Add renew exp_date sanity check
This commit is contained in:
parent
016c5e802c
commit
546330b178
7 changed files with 15 additions and 13 deletions
|
@ -72,11 +72,11 @@ module Epp
|
|||
|
||||
def renew
|
||||
authorize! :renew, @domain
|
||||
return handle_errors(@domain) if invalid_expiry_date?
|
||||
|
||||
registrar_id = current_user.registrar.id
|
||||
renew_params = ::Deserializers::Xml::Domain.new(params[:parsed_frame],
|
||||
registrar_id).call
|
||||
|
||||
action = Actions::DomainRenew.new(@domain, renew_params, current_user.registrar)
|
||||
if action.call
|
||||
render_epp_response '/epp/domains/renew'
|
||||
|
@ -228,11 +228,6 @@ module Epp
|
|||
statuses == [::DomainStatus::CLIENT_HOLD]
|
||||
end
|
||||
|
||||
def invalid_expiry_date?
|
||||
@domain.validate_exp_dates(params[:parsed_frame].css('curExpDate').text)
|
||||
@domain.errors[:epp_errors].any?
|
||||
end
|
||||
|
||||
def balance_ok?(operation, period = nil, unit = nil)
|
||||
@domain_pricelist = @domain.pricelist(operation, period.try(:to_i), unit)
|
||||
if @domain_pricelist.try(:price) # checking if price list is not found
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue