mirror of
https://github.com/internetee/registry.git
synced 2025-08-01 15:34:41 +02:00
implemented method which get invoice number from billins side and updated tests
This commit is contained in:
parent
390d693b13
commit
9f4942e522
8 changed files with 191 additions and 10 deletions
27
app/services/eis_billing/get_invoice_number.rb
Normal file
27
app/services/eis_billing/get_invoice_number.rb
Normal file
|
@ -0,0 +1,27 @@
|
|||
module EisBilling
|
||||
class GetInvoiceNumber < EisBilling::Base
|
||||
attr_reader :invoice
|
||||
|
||||
def self.send_invoice
|
||||
base_request
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def self.base_request
|
||||
uri = URI(invoice_generator_url)
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
headers = {
|
||||
'Authorization' => 'Bearer foobar',
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => TOKEN
|
||||
}
|
||||
|
||||
http.post(invoice_generator_url, nil, headers)
|
||||
end
|
||||
|
||||
def self.invoice_generator_url
|
||||
"#{BASE_URL}/api/v1/invoice_generator/invoice_number_generator"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue