Class: Mollie::Refund

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

Constant Summary collapse

STATUS_QUEUED =
'queued'.freeze
STATUS_PENDING =
'pending'.freeze
STATUS_PROCESSING =
'processing'.freeze
STATUS_REFUNDED =
'refunded'.freeze
STATUS_FAILED =
'failed'.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.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def _links
  @_links
end

#amountObject

Returns the value of attribute amount.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def amount
  @amount
end

#created_atObject

Returns the value of attribute created_at.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def created_at
  @created_at
end

#descriptionObject

Returns the value of attribute description.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def description
  @description
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def id
  @id
end

#linesObject

Returns the value of attribute lines.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def lines
  @lines
end

#metadataObject

Returns the value of attribute metadata.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def 
  @metadata
end

#order_idObject

Returns the value of attribute order_id.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def order_id
  @order_id
end

#payment_idObject

Returns the value of attribute payment_id.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def payment_id
  @payment_id
end

#settlement_amountObject

Returns the value of attribute settlement_amount.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def settlement_amount
  @settlement_amount
end

#settlement_idObject

Returns the value of attribute settlement_id.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def settlement_id
  @settlement_id
end

#statusObject

Returns the value of attribute status.



9
10
11
# File 'lib/mollie/refund.rb', line 9

def status
  @status
end

Instance Method Details

#failed?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/mollie/refund.rb', line 40

def failed?
  status == STATUS_FAILED
end

#order(options = {}) ⇒ Object



77
78
79
80
# File 'lib/mollie/refund.rb', line 77

def order(options = {})
  return if order_id.nil?
  Order.get(order_id, options)
end

#payment(options = {}) ⇒ Object



68
69
70
# File 'lib/mollie/refund.rb', line 68

def payment(options = {})
  Payment.get(payment_id, options)
end

#pending?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/mollie/refund.rb', line 28

def pending?
  status == STATUS_PENDING
end

#processing?Boolean

Returns:

  • (Boolean)


32
33
34
# File 'lib/mollie/refund.rb', line 32

def processing?
  status == STATUS_PROCESSING
end

#queued?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/mollie/refund.rb', line 24

def queued?
  status == STATUS_QUEUED
end

#refunded?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/mollie/refund.rb', line 36

def refunded?
  status == STATUS_REFUNDED
end

#settlement(options = {}) ⇒ Object



72
73
74
75
# File 'lib/mollie/refund.rb', line 72

def settlement(options = {})
  return if settlement_id.nil?
  Settlement.get(settlement_id, options)
end