mirror of
https://github.com/internetee/registry.git
synced 2025-07-29 14:06:21 +02:00
added link generator into admin part
This commit is contained in:
parent
9f4942e522
commit
9b6b8a5e2f
8 changed files with 135 additions and 2 deletions
|
@ -13,6 +13,7 @@ module Admin
|
|||
|
||||
if @invoice&.persisted?
|
||||
flash[:notice] = t(:record_created)
|
||||
send_invoice_data_to_billing_system
|
||||
redirect_to [:admin, @invoice]
|
||||
else
|
||||
flash.now[:alert] = t(:failed_to_create_record)
|
||||
|
@ -100,5 +101,14 @@ module Admin
|
|||
|
||||
invoices.where(account_activities: { created_at: date_from..date_until })
|
||||
end
|
||||
|
||||
def send_invoice_data_to_billing_system
|
||||
add_invoice_instance = EisBilling::AddDeposits.new(@invoice)
|
||||
result = add_invoice_instance.send_invoice
|
||||
|
||||
link = JSON.parse(result.body)['everypay_link']
|
||||
|
||||
@invoice.update(payment_link: link)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue