mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 03:30:33 +02:00
Full period unit support
This commit is contained in:
parent
9371b2ad67
commit
73cb8c604d
3 changed files with 14 additions and 5 deletions
|
@ -36,6 +36,10 @@ module Epp::DomainsHelper
|
|||
end
|
||||
|
||||
def domain_create_params
|
||||
period = (@ph[:period].to_i == 0) ? 1 : @ph[:period].to_i
|
||||
period_unit = Domain.parse_period_unit_from_frame(parsed_frame) || 'y'
|
||||
valid_to = Date.today + Domain.convert_period_to_time(period, period_unit)
|
||||
|
||||
{
|
||||
name: @ph[:name],
|
||||
registrar_id: current_epp_user.registrar.try(:id),
|
||||
|
@ -43,7 +47,7 @@ module Epp::DomainsHelper
|
|||
period: (@ph[:period].to_i == 0) ? 1 : @ph[:period].to_i,
|
||||
period_unit: Domain.parse_period_unit_from_frame(parsed_frame) || 'y',
|
||||
valid_from: Date.today,
|
||||
valid_to: Date.today + @ph[:period].to_i.years,
|
||||
valid_to: valid_to,
|
||||
auth_info: @ph[:authInfo][:pw]
|
||||
}
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue