class Invoiced::Customer

Constants

OBJECT_NAME

Public Instance Methods

balance() click to toggle source
# File lib/invoiced/customer.rb, line 34
def balance
    response = @client.request(:get, "#{self.endpoint()}/balance")

    response[:body]
end
consolidate_invoices(params={}) click to toggle source
# File lib/invoiced/customer.rb, line 68
def consolidate_invoices(params={})
    response = @client.request(:post, "#{self.endpoint()}/consolidate_invoices", params)

    # build invoice object
    invoice = Invoice.new(@client)
    Util.convert_to_object(invoice, response[:body])
end
contacts() click to toggle source
# File lib/invoiced/customer.rb, line 40
def contacts()
    contact = Contact.new(@client)
    contact.set_endpoint_base(self.endpoint())
end
invoice(params={}, opts={}) click to toggle source
# File lib/invoiced/customer.rb, line 60
def invoice(params={}, opts={})
    response = @client.request(:post, "#{self.endpoint()}/invoices", params, opts)

    # build invoice object
    invoice = Invoice.new(@client)
    Util.convert_to_object(invoice, response[:body])
end
line_items() click to toggle source
# File lib/invoiced/customer.rb, line 50
def line_items()
    line = LineItem.new(@client)
    line.set_endpoint_base(self.endpoint())
end
list_notes() click to toggle source
# File lib/invoiced/customer.rb, line 55
def list_notes()
    note = Note.new(@client)
    note.set_endpoint_base(self.endpoint())
end
payment_sources() click to toggle source
# File lib/invoiced/customer.rb, line 45
def payment_sources()
    source = PaymentSource.new(@client)
    source.set_endpoint_base(self.endpoint())
end
send_statement(params={}, opts={}) click to toggle source
# File lib/invoiced/customer.rb, line 10
def send_statement(params={}, opts={})
    response = @client.request(:post, "#{self.endpoint()}/emails", params, opts)

    # build email objects
    email = Email.new(@client)
    Util.build_objects(email, response[:body])
end
send_statement_letter(params={}, opts={}) click to toggle source
# File lib/invoiced/customer.rb, line 26
def send_statement_letter(params={}, opts={})
    response = @client.request(:post, "#{self.endpoint()}/letters", params, opts)

    # build letter objects
    letter = Letter.new(@client)
    Util.build_objects(letter, response[:body])
end
send_statement_sms(params={}, opts={}) click to toggle source
# File lib/invoiced/customer.rb, line 18
def send_statement_sms(params={}, opts={})
    response = @client.request(:post, "#{self.endpoint()}/text_messages", params, opts)

    # build text message objects
    text_message = TextMessage.new(@client)
    Util.build_objects(text_message, response[:body])
end