Move bulk domain renew BL to REPP

This commit is contained in:
Karl Erik Õunapuu 2020-12-18 14:41:34 +02:00
parent 13455b398c
commit b8aeba6beb
No known key found for this signature in database
GPG key ID: C9DD647298A34764
5 changed files with 70 additions and 11 deletions

View file

@ -30,6 +30,15 @@ module Depp
['10 years', '10y'],
]
def self.bulk_renew(domains, period, _registrar)
payload = { domains: domains, renew_period: period }
headers = { Authorization: 'Basic dGVzdDp0ZXN0MTIz' }
RestClient.post("#{ENV['repp_url']}domains/renew/bulk", payload, headers).response
rescue RestClient::ExceptionWithResponse => e
e.response
end
def initialize(args = {})
self.current_user = args[:current_user]
self.epp_xml = EppXml::Domain.new(cl_trid_prefix: current_user.tag)