mirror of
https://github.com/internetee/registry.git
synced 2025-06-11 23:24:48 +02:00
Fix domain renew porting to actions
This commit is contained in:
parent
9a7827107f
commit
988af6c91c
3 changed files with 12 additions and 1 deletions
|
@ -72,7 +72,7 @@ module Epp
|
|||
|
||||
def renew
|
||||
authorize! :renew, @domain
|
||||
@domain.validate_exp_dates(params[:parsed_frame].css('curExpDate').text)
|
||||
return handle_errors(@domain) if invalid_expiry_date?
|
||||
|
||||
registrar_id = current_user.registrar.id
|
||||
renew_params = ::Deserializers::Xml::Domain.new(params[:parsed_frame],
|
||||
|
@ -228,6 +228,11 @@ 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