mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 10:45:58 +02:00
made support test schema domain version 1.2
This commit is contained in:
parent
ae6bad3e73
commit
4c5e4d7898
41 changed files with 967 additions and 451 deletions
|
@ -29,16 +29,34 @@ class Registrar
|
|||
render plain: xml
|
||||
end
|
||||
|
||||
protected
|
||||
private
|
||||
|
||||
def prepare_payload(xml, cl_trid)
|
||||
PREFS.map do |pref|
|
||||
xml.gsub!('"' + pref.to_s + '"',
|
||||
"\"#{Xsd::Schema.filename(for_prefix: pref.to_s)}\"")
|
||||
xml = load_schema_by_prefix(pref, xml)
|
||||
end
|
||||
|
||||
xml.gsub!('<clTRID>ABC-12345</clTRID>', "<clTRID>#{cl_trid}</clTRID>")
|
||||
xml
|
||||
end
|
||||
|
||||
def load_schema_by_prefix(pref, xml)
|
||||
case pref
|
||||
when 'epp-ee'
|
||||
insert_prefix_and_version(xml, pref, '1.0')
|
||||
when 'eis'
|
||||
insert_prefix_and_version(xml, pref, '1.0')
|
||||
when 'contact-ee'
|
||||
insert_prefix_and_version(xml, pref, '1.1')
|
||||
else
|
||||
insert_prefix_and_version(xml, pref, '1.1')
|
||||
end
|
||||
end
|
||||
|
||||
def insert_prefix_and_version(xml, pref, version)
|
||||
xml.gsub!('"' + pref.to_s + '"',
|
||||
"\"#{Xsd::Schema.filename(for_prefix: pref.to_s, for_version: version)}\"")
|
||||
xml
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue