Refactor epp requests closer to international standard

This commit is contained in:
Martin Lensment 2014-07-03 17:47:53 +03:00
parent 4684b311a2
commit 9def6a7c27
11 changed files with 81 additions and 70 deletions

View file

@ -1,6 +1,6 @@
module Epp::ContactsHelper
def create_contact
ph = get_params_hash('epp command create create')[:create]
ph = params_hash
@contact = Contact.new(
code: ph[:id],

View file

@ -5,7 +5,7 @@ module Epp::DomainsHelper
end
def check_domain
ph = get_params_hash('epp command check check')[:check]
ph = params_hash['epp']['command']['check']['check']
@domains = Domain.check_availability(ph[:name])
render '/epp/domains/check'
end
@ -13,7 +13,7 @@ module Epp::DomainsHelper
### HELPER METHODS ###
def domain_create_params
ph = get_params_hash('epp command create create')[:create]
ph = params_hash['epp']['command']['create']['create']
{
name: ph[:name],
@ -21,7 +21,7 @@ module Epp::DomainsHelper
registered_at: Time.now,
valid_from: Date.today,
valid_to: Date.today + ph[:period].to_i.years,
auth_info: ph[:authInfo]
auth_info: ph[:authInfo][:pw]
}
end
end