Class: Cetustek::CreateInvoice
- Inherits:
-
Object
- Object
- Cetustek::CreateInvoice
- Defined in:
- lib/cetustek/create_invoice.rb
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(invoice_data) ⇒ CreateInvoice
constructor
A new instance of CreateInvoice.
Constructor Details
#initialize(invoice_data) ⇒ CreateInvoice
Returns a new instance of CreateInvoice.
10 11 12 |
# File 'lib/cetustek/create_invoice.rb', line 10 def initialize(invoice_data) @invoice_data = invoice_data end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/cetustek/create_invoice.rb', line 14 def execute xml = Services::InvoiceXmlBuilder.new(@invoice_data).build response = Services::InvoiceService.new(xml, @invoice_data.order_id).create result = Services::ResponseHandler.new(response, @invoice_data, xml).process if defined?(Rails) && result[:number] && result[:random_number] update_invoice_info(result) end result end |