mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 02:05:57 +02:00
Do not require address in registrar area unless address_processing is enabled
#251
This commit is contained in:
parent
99a928fd3a
commit
8cc2d030b8
4 changed files with 110 additions and 45 deletions
|
@ -150,18 +150,21 @@ module Depp
|
|||
postalInfo: {
|
||||
name: { value: name },
|
||||
org: { value: org_name },
|
||||
addr: {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
sp: { value: state },
|
||||
pc: { value: zip },
|
||||
cc: { value: country_code }
|
||||
}
|
||||
},
|
||||
voice: { value: phone },
|
||||
email: { value: email }
|
||||
}
|
||||
|
||||
if ::Contact.address_processing?
|
||||
hash[:postalInfo][:addr] = {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
sp: { value: state },
|
||||
pc: { value: zip },
|
||||
cc: { value: country_code },
|
||||
}
|
||||
end
|
||||
|
||||
hash[:id] = nil if code.blank?
|
||||
create_xml = Depp::Contact.epp_xml.create(hash, extension_xml(:create))
|
||||
|
||||
|
@ -182,36 +185,41 @@ module Depp
|
|||
self.phone = params[:phone]
|
||||
|
||||
self.org_name = params[:org_name]
|
||||
self.street = params[:street]
|
||||
self.city = params[:city]
|
||||
self.zip = params[:zip]
|
||||
self.state = params[:state]
|
||||
self.country_code = params[:country_code]
|
||||
|
||||
update_xml = Depp::Contact.epp_xml.update(
|
||||
{
|
||||
id: { value: id },
|
||||
chg: {
|
||||
postalInfo: {
|
||||
name: { value: name },
|
||||
org: { value: org_name },
|
||||
addr: {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
sp: { value: state },
|
||||
pc: { value: zip },
|
||||
cc: { value: country_code }
|
||||
}
|
||||
},
|
||||
voice: { value: phone },
|
||||
email: { value: email },
|
||||
authInfo: {
|
||||
pw: { value: password }
|
||||
}
|
||||
if ::Contact.address_processing?
|
||||
self.street = params[:street]
|
||||
self.city = params[:city]
|
||||
self.zip = params[:zip]
|
||||
self.state = params[:state]
|
||||
self.country_code = params[:country_code]
|
||||
end
|
||||
|
||||
attributes = {
|
||||
id: { value: id },
|
||||
chg: {
|
||||
postalInfo: {
|
||||
name: { value: name },
|
||||
org: { value: org_name },
|
||||
},
|
||||
voice: { value: phone },
|
||||
email: { value: email },
|
||||
authInfo: {
|
||||
pw: { value: password }
|
||||
}
|
||||
},
|
||||
extension_xml(:update)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
if ::Contact.address_processing?
|
||||
attributes[:chg][:postalInfo][:addr] = {
|
||||
street: { value: street },
|
||||
city: { value: city },
|
||||
sp: { value: state },
|
||||
pc: { value: zip },
|
||||
cc: { value: country_code }
|
||||
}
|
||||
end
|
||||
|
||||
update_xml = Depp::Contact.epp_xml.update(attributes, extension_xml(:update))
|
||||
data = Depp::Contact.user.request(update_xml)
|
||||
handle_errors(data)
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue