Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing namespace to contact xmls #2

Open
wants to merge 30 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
c602856
added namespace support and authInfo to contact check
Jul 22, 2014
8d3b7a1
fixed contact check response. It was showing only the last record que…
Jul 22, 2014
14519a4
added namespace support to contact info
Jul 22, 2014
3428a3c
added namespace support to contact create
Jul 22, 2014
2991a86
added namespace support to contact delete
Jul 22, 2014
b47e651
added namespace support to domain check
Jul 23, 2014
c0b043c
added namespace support to domain info
Jul 23, 2014
a0e55e1
added crID field to domain info response
Jul 23, 2014
1611832
added namespace support to contatct update
Jul 23, 2014
b94af79
added namespace support to domain create
Jul 23, 2014
5539f84
added namespace support to domain update
Jul 23, 2014
4207dd9
added namespace support to domain delete
Jul 23, 2014
1fbace1
Replacing Builder::XmlMarkup by Nokogiri::XML::Builder
Oct 31, 2014
7f78265
updating Gemfile.lock
Oct 31, 2014
111ad71
bump to version 0.13.3
Oct 31, 2014
e20bb9c
setting env for testing
Oct 31, 2014
759d31d
fixing authInfo on ContatcInfo
Oct 31, 2014
4485870
Merge branch 'master' into testing
Oct 31, 2014
37b80b4
Fixed disclose with no type value on contact info.
Oct 31, 2014
2c83c12
added initial tests
Oct 31, 2014
375781e
removing authInfo from contact check
Nov 3, 2014
147a6c8
changed xml size count to bitesize to support two bytes characteres
Dec 11, 2014
eaf18fc
added test for contact_check with single item
Jan 16, 2015
5915132
set extension to return a simple xml to make compatible with tests
Jan 16, 2015
3d23386
added msg_id and msg_count to the return message of poll_req
Jan 16, 2015
84bead3
Removed builder requirement.
Jan 16, 2015
4d56bd0
removed wrong sintax
Jan 16, 2015
bc57b17
Fixed some missing namespace definitions.
Jan 16, 2015
3f26b68
Moved to new gem file
Jan 16, 2015
1e588bd
bump to version 1.0.3
Jan 16, 2015
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed some missing namespace definitions.
Added domin renew function
Ernesto Thorp committed Jan 16, 2015
commit bc57b17a8eb1b3ceee8bb3429ca1c7cf29725e3f
35 changes: 33 additions & 2 deletions lib/epp-client/domain.rb
Original file line number Diff line number Diff line change
@@ -229,7 +229,7 @@ def domain_create_xml(args) #:nodoc:
if args.key?(:ns)
domain_nss_xml(xml, args[:ns])
end
xml.registrant args[:registrant] if args.key?(:registrant)
xml[DOMAIN_NS].registrant args[:registrant] if args.key?(:registrant)
if args.key?(:contacts)
domain_contacts_xml(xml, args[:contacts])
end
@@ -337,7 +337,7 @@ def domain_update_xml(args) #:nodoc:
end
end
if args.key?(:chg) && (args[:chg].key?(:registrant) || args[:chg].key?(:authInfo))
xml.chg do
xml[DOMAIN_NS].chg do
if args[:chg].key?(:registrant)
xml[DOMAIN_NS].registrant args[:chg][:registrant]
end
@@ -414,5 +414,36 @@ def domain_transfer_response(xml) #:nodoc:
end
ret
end

def domain_renew(args)
response = send_request(domain_renew_xml(args))

get_result(:xml => response, :callback => :domain_renew_process)
end

def domain_renew_xml(args)
command do |xml|
xml.renew do
xml.renew do
xml.parent.namespace = xml.parent.add_namespace_definition(DOMAIN_NS, EPPClient::SCHEMAS_URL[DOMAIN_NS])
xml[DOMAIN_NS].name args[:name]
xml[DOMAIN_NS].curExpDate args[:curExpDate]
if args.key?(:period)
xml[DOMAIN_NS].period({:unit => args[:period][:unit]}, args[:period][:value])
end
end
end
end
end

def domain_renew_process(xml)
dom = xml.xpath('//domain:renData', EPPClient::SCHEMAS_URL).children
res = {:name => dom.xpath('//domain:name', EPPClient::SCHEMAS_URL).text}
unless (result = dom.xpath('//domain:exDate', EPPClient::SCHEMAS_URL).text).empty?
res[:exDate] = DateTime.parse(result)
end
res
end

end
end