mirror of
https://github.com/internetee/registry.git
synced 2025-08-03 08:22:05 +02:00
Contact creation improvements
This commit is contained in:
parent
acb65c47d6
commit
6a456240fa
7 changed files with 39 additions and 7 deletions
|
@ -1,5 +1,22 @@
|
|||
module Epp::ContactsHelper
|
||||
def create_contact
|
||||
cp = Hash.from_xml(parsed_frame.css("epp command create create").to_xml).with_indifferent_access
|
||||
ph = get_params_hash('epp command create create')[:create]
|
||||
|
||||
@contact = Contact.new(
|
||||
code: ph[:id],
|
||||
name: ph[:postalInfo][:name],
|
||||
phone: ph[:voice],
|
||||
email: ph[:email],
|
||||
reg_no: ph[:ident]
|
||||
)
|
||||
|
||||
@contact.addresses << Address.new(
|
||||
country_id: Country.find_by(iso: ph[:postalInfo][:cc]),
|
||||
street: ph[:postalInfo][:street],
|
||||
zip: ph[:postalInfo][:pc]
|
||||
)
|
||||
|
||||
@contact.save
|
||||
render '/epp/contacts/create'
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue