mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 03:06:14 +02:00
Improve bulk renew tests
This commit is contained in:
parent
66114aa648
commit
04944b8ac4
6 changed files with 62 additions and 35 deletions
11
app/models/repp_api.rb
Normal file
11
app/models/repp_api.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
class ReppApi
|
||||
def self.bulk_renew(domains, period, registrar)
|
||||
payload = { domains: domains, renew_period: period }
|
||||
token = Base64.urlsafe_encode64("#{registrar.username}:#{registrar.plain_text_password}")
|
||||
headers = { Authorization: "Basic #{token}" }
|
||||
|
||||
RestClient.post("#{ENV['repp_url']}domains/renew/bulk", payload, headers)
|
||||
rescue RestClient::ExceptionWithResponse => e
|
||||
e.response
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue