Class: Kentaa::Api::Resources::Order
Instance Attribute Summary
Attributes inherited from Resource
#id
Attributes inherited from Base
#config, #endpoint_path, #options, #resource_class
Instance Method Summary
collapse
Methods inherited from Resource
#create, #created_at, #delete, #initialize, #load, #save, #updated_at
Methods inherited from Base
attribute_key, #initialize, #load, #loaded?
Instance Method Details
#action_id ⇒ Object
26
27
28
|
# File 'lib/kentaa/api/resources/order.rb', line 26
def action_id
data[:action_id]
end
|
#address ⇒ Object
66
67
68
|
# File 'lib/kentaa/api/resources/order.rb', line 66
def address
@address ||= Kentaa::Api::Resources::Address.new(data[:address]) if data[:address]
end
|
#company ⇒ Object
46
47
48
|
# File 'lib/kentaa/api/resources/order.rb', line 46
def company
data[:company]
end
|
#currency ⇒ Object
50
51
52
|
# File 'lib/kentaa/api/resources/order.rb', line 50
def currency
data[:currency]
end
|
#first_name ⇒ Object
30
31
32
|
# File 'lib/kentaa/api/resources/order.rb', line 30
def first_name
data[:first_name]
end
|
#infix ⇒ Object
34
35
36
|
# File 'lib/kentaa/api/resources/order.rb', line 34
def infix
data[:infix]
end
|
#invoicenumber ⇒ Object
58
59
60
|
# File 'lib/kentaa/api/resources/order.rb', line 58
def invoicenumber
data[:invoicenumber]
end
|
#items ⇒ Object
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/kentaa/api/resources/order.rb', line 78
def items
@items ||= begin
items = []
if data[:items]
data[:items].each do |item|
items << Kentaa::Api::Resources::OrderItem.new(item)
end
end
items
end
end
|
#last_name ⇒ Object
38
39
40
|
# File 'lib/kentaa/api/resources/order.rb', line 38
def last_name
data[:last_name]
end
|
#locale ⇒ Object
74
75
76
|
# File 'lib/kentaa/api/resources/order.rb', line 74
def locale
data[:locale]
end
|
#name ⇒ Object
42
43
44
|
# File 'lib/kentaa/api/resources/order.rb', line 42
def name
[first_name, infix, last_name].reject { |s| s.to_s.empty? }.join(' ')
end
|
#payment_status ⇒ Object
62
63
64
|
# File 'lib/kentaa/api/resources/order.rb', line 62
def payment_status
data[:payment_status]
end
|
#phone ⇒ Object
70
71
72
|
# File 'lib/kentaa/api/resources/order.rb', line 70
def phone
data[:phone]
end
|
#site ⇒ Object
18
19
20
|
# File 'lib/kentaa/api/resources/order.rb', line 18
def site
Kentaa::Api::Resources::Site.new(config, id: site_id, options: options)
end
|
#site_id ⇒ Object
22
23
24
|
# File 'lib/kentaa/api/resources/order.rb', line 22
def site_id
data[:site_id]
end
|
#total_amount ⇒ Object
54
55
56
|
# File 'lib/kentaa/api/resources/order.rb', line 54
def total_amount
BigDecimal(data[:total_amount])
end
|