mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 01:47:18 +02:00
27 lines
670 B
Ruby
27 lines
670 B
Ruby
module Epp::DomainsHelper
|
|
def create_domain
|
|
domain = Domain.create!(domain_create_params)
|
|
render '/epp/domains/create'
|
|
end
|
|
|
|
def check_domain
|
|
ph = get_params_hash('epp command check check')[:check]
|
|
@domains = Domain.check_availability(ph[:name])
|
|
render '/epp/domains/check'
|
|
end
|
|
|
|
### HELPER METHODS ###
|
|
|
|
def domain_create_params
|
|
ph = get_params_hash('epp command create create')[:create]
|
|
|
|
{
|
|
name: ph[:name],
|
|
registrar_id: current_epp_user.registrar.try(:id),
|
|
registered_at: Time.now,
|
|
valid_from: Date.today,
|
|
valid_to: Date.today + ph[:period].to_i.years,
|
|
auth_info: ph[:authInfo]
|
|
}
|
|
end
|
|
end
|