Class: Infuser::Tables::Invoice

Inherits:
Base
  • Object
show all
Defined in:
lib/infuser/tables/invoice.rb

Constant Summary

Constants inherited from Base

Base::PAGINATION

Instance Method Summary collapse

Methods inherited from Base

#all, #find, #find_by, #initialize

Methods included from Helpers::Hashie

#camelize_hash, #safe_classify

Constructor Details

This class inherits a constructor from Infuser::Tables::Base

Instance Method Details

#build(data) ⇒ Object

Raises:

  • (NotImplementedError)


5
6
7
# File 'lib/infuser/tables/invoice.rb', line 5

def build data
  raise(NotImplementedError, 'You must use #create method for invoices. Infusionsoft is a delight :)')
end

#create(*data) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/infuser/tables/invoice.rb', line 9

def create *data
  # Add in specific order:
  # contact_id, description, date, then:
  # lead_affiliate_id 0 should be used if none
  # sale_affiliate_id 0 should be used if none
  id = client.get("InvoiceService.createBlankOrder", *data)
  find(id)
end