mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 17:59:47 +02:00
Refactor #2763
This commit is contained in:
parent
d62a5d5b9b
commit
46a2a3b5fe
2 changed files with 4 additions and 7 deletions
|
@ -95,13 +95,9 @@ class Epp::DomainsController < EppController
|
||||||
def renew
|
def renew
|
||||||
authorize! :renew, @domain
|
authorize! :renew, @domain
|
||||||
|
|
||||||
period = params[:parsed_frame].css('period').text.presence || 1
|
period_element = params[:parsed_frame].css('period').text
|
||||||
period_unit = 'y'
|
period = (period_element.to_i == 0) ? 1 : period_element.to_i
|
||||||
period_element = params[:parsed_frame].css('period').first
|
period_unit = Epp::Domain.parse_period_unit_from_frame(params[:parsed_frame]) || 'y'
|
||||||
|
|
||||||
if period_element.present? && period_element['unit'].present?
|
|
||||||
period_unit = period_element['unit']
|
|
||||||
end
|
|
||||||
|
|
||||||
ActiveRecord::Base.transaction do
|
ActiveRecord::Base.transaction do
|
||||||
success = @domain.renew(
|
success = @domain.renew(
|
||||||
|
|
|
@ -18,6 +18,7 @@ Domain name mapping protocol short version:
|
||||||
<domain:period> 0-1 Registration period for domain.
|
<domain:period> 0-1 Registration period for domain.
|
||||||
Must add up to 1 / 2 / 3 years.
|
Must add up to 1 / 2 / 3 years.
|
||||||
Attribute: unit="y/m/d"
|
Attribute: unit="y/m/d"
|
||||||
|
Default is 1 year.
|
||||||
<domain:registrant> 1 Contact reference to the registrant
|
<domain:registrant> 1 Contact reference to the registrant
|
||||||
Attribute:
|
Attribute:
|
||||||
"verified" # optional, allowed values 'yes', 'no'
|
"verified" # optional, allowed values 'yes', 'no'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue