Class: Mollie::Invoice

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

Defined Under Namespace

Classes: Line

Constant Summary collapse

STATUS_OPEN =
'open'.freeze
STATUS_PAID =
'paid'.freeze
STATUS_OVERDUE =
'overdue'.freeze

Instance Attribute Summary collapse

Attributes inherited from Base

#attributes

Instance Method Summary collapse

Methods inherited from Base

all, #assign_attributes, cancel, create, #delete, delete, get, id_param, #initialize, parent_id, request, resource_name, update, #update

Constructor Details

This class inherits a constructor from Mollie::Base

Instance Attribute Details

Returns the value of attribute _links.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def _links
  @_links
end

#due_atObject

Returns the value of attribute due_at.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def due_at
  @due_at
end

#gross_amountObject

Returns the value of attribute gross_amount.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def gross_amount
  @gross_amount
end

#idObject

Returns the value of attribute id.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def id
  @id
end

#issued_atObject

Returns the value of attribute issued_at.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def issued_at
  @issued_at
end

#linesObject

Returns the value of attribute lines.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def lines
  @lines
end

#net_amountObject

Returns the value of attribute net_amount.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def net_amount
  @net_amount
end

Returns the value of attribute paid_at.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def paid_at
  @paid_at
end

#referenceObject

Returns the value of attribute reference.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def reference
  @reference
end

#statusObject

Returns the value of attribute status.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def status
  @status
end

#vat_amountObject

Returns the value of attribute vat_amount.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def vat_amount
  @vat_amount
end

#vat_numberObject

Returns the value of attribute vat_number.



15
16
17
# File 'lib/mollie/invoice.rb', line 15

def vat_number
  @vat_number
end

Instance Method Details

#open?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/mollie/invoice.rb', line 30

def open?
  status == STATUS_OPEN
end

#overdue?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/mollie/invoice.rb', line 38

def overdue?
  status == STATUS_OVERDUE
end

#paid?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/mollie/invoice.rb', line 34

def paid?
  status == STATUS_PAID
end

#pdfObject



74
75
76
# File 'lib/mollie/invoice.rb', line 74

def pdf
  Util.extract_url(links, 'pdf')
end