mirror of
https://github.com/internetee/registry.git
synced 2025-05-20 19:29:39 +02:00
21 lines
491 B
Ruby
21 lines
491 B
Ruby
module Epp::ContactsHelper
|
|
def create_contact
|
|
ph = params_hash['epp']['command']['create']['create']
|
|
|
|
@contact = Contact.new(
|
|
code: ph[:id],
|
|
name: ph[:postalInfo][:name],
|
|
phone: ph[:voice],
|
|
email: ph[:email]
|
|
)
|
|
|
|
@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
|