EPP Client
Client for communicating with EPP services
Installation
Add this line to your application's Gemfile:
gem 'epp-client'
And then execute:
$ bundle
Or install it yourself as:
$ gem install epp-client
Version 2.0.0
The version has been bumped to 2.0.0 due to the introduction of a backwards incompatible change.
EPP::Domain::InfoResponse#statusnow returns an array of statuses as part of m247/epp-client#7.
Usage
client = EPP::Client.new('username', 'password', 'epp.server.com')
client.hello
puts client.last_request.to_s(:indent => 2)
puts client.last_response.to_s(:indent => 2)
The old method_missing behaviour has been removed and replaced with defined
methods for handling each of the distinct EPP commands.
checkcreatedeleteinforenewtransferupdatepollack
each of these methods, with the exception of poll and ack, accept two arguments.
Those arguments are a payload and an optional extension. The majority of the
common domain, contact and host payloads have been defined already.
Domain Check Example
resp = client.check EPP::Domain::Check.new('example.com', 'example.net', 'example.org')
check = EPP::Domain::CheckResponse.new(resp)
check.available?('example.com') #=> true
check.available?('example.net') #=> false
check.available?('example.org') #=> false
Domain Information Example
resp = client.info EPP::Domain::Info.new('example.com')
info = EPP::Domain::InfoResponse.new(resp)
info.name #=> "example.com"
info.nameservers #=> [{"name"=>"ns1.example.net"},{"name"=>"ns2.example.net"}]
Payload an Extension API
The objects which are passed to the client methods need to adhere to the following
API in order to be successfully marshalled by the client into the required XML
document.
nameto specify the EPP command name. Required.to_xmlreturns anXML::Document. Required.set_namespacesto receiveXML::Namespaceobjects from the parent. Optional.
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Added some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request