mirror of
https://github.com/internetee/registry.git
synced 2025-08-06 01:35:10 +02:00
remove uneccessary code, adapted to eis billing response, fix logging error
This commit is contained in:
parent
d1e64577b4
commit
ac3244466e
6 changed files with 6 additions and 69 deletions
|
@ -23,33 +23,8 @@ module EisBilling
|
|||
data[:invoice_number] = invoice.number
|
||||
|
||||
data
|
||||
|
||||
# invoice = @invoice.to_json(except: [ :order_reference,
|
||||
# :created_at,
|
||||
# :updated_at,
|
||||
# :e_invoice_sent_at,
|
||||
# :items_attributes])
|
||||
|
||||
# parsed_data = JSON.parse(invoice)
|
||||
# parsed_data['role'] = 'registrar'
|
||||
# parsed_data['source'] = 'registry'
|
||||
# parsed_data['description'] = 'some' if parsed_data['description'] == ''
|
||||
|
||||
# parsed_data = replace_key(json_obj: parsed_data, old_key: 'total', new_key: 'transaction_amount')
|
||||
# parsed_data = replace_key(json_obj: parsed_data, old_key: 'reference_no', new_key: 'reference_number')
|
||||
|
||||
# invoice_items_json = @invoice.items.to_json(except: [ :created_at, :updated_at ])
|
||||
# parsed_data['items'] = JSON.parse(invoice_items_json)
|
||||
# parsed_data
|
||||
end
|
||||
|
||||
# def replace_key(json_obj:, old_key:, new_key:)
|
||||
# json_obj[new_key] = json_obj[old_key]
|
||||
# json_obj.delete(old_key)
|
||||
|
||||
# json_obj
|
||||
# end
|
||||
|
||||
def base_request(json_obj:)
|
||||
uri = URI(invoice_generator_url)
|
||||
http = Net::HTTP.new(uri.host, uri.port)
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
module EisBilling
|
||||
class GetInvoiceLink < EisBilling::Base
|
||||
attr_reader :invoice_number
|
||||
|
||||
def initialize(invoice_number)
|
||||
@invoice_number = invoice_number
|
||||
end
|
||||
|
||||
def send_request
|
||||
base_request
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def 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
|
||||
}
|
||||
|
||||
res = http.get(invoice_generator_url + "?invoice_number=#{@invoice_number}", headers)
|
||||
res
|
||||
end
|
||||
|
||||
def invoice_generator_url
|
||||
"#{BASE_URL}/api/v1/get_invoice_payment_link/show"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue