Class: Omise::Charge
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from OmiseObject
location, resource
Methods included from Attributes
#[], #as_json, #assign_attributes, #attributes, #destroyed?, #initialize, #key?, #location, #method_missing, #respond_to?
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
in the class Omise::Attributes
Class Method Details
.create(attributes = {}) ⇒ Object
19
20
21
|
# File 'lib/omise/charge.rb', line 19
def self.create(attributes = {})
new resource(location, attributes).post(attributes)
end
|
.list(attributes = {}) ⇒ Object
15
16
17
|
# File 'lib/omise/charge.rb', line 15
def self.list(attributes = {})
List.new resource(location, attributes).get
end
|
.retrieve(id, attributes = {}) ⇒ Object
11
12
13
|
# File 'lib/omise/charge.rb', line 11
def self.retrieve(id, attributes = {})
new resource(location(id), attributes).get
end
|
Instance Method Details
#customer(options = {}) ⇒ Object
31
32
33
34
35
|
# File 'lib/omise/charge.rb', line 31
def customer(options = {})
if @attributes["customer"]
@customer ||= Customer.retrieve(@attributes["customer"], options)
end
end
|
#refunds ⇒ Object
43
44
45
|
# File 'lib/omise/charge.rb', line 43
def refunds
@refunds ||= RefundList.new(self, @attributes["refunds"])
end
|
#reload(attributes = {}) ⇒ Object
23
24
25
|
# File 'lib/omise/charge.rb', line 23
def reload(attributes = {})
assign_attributes resource(attributes).get
end
|
#transaction(options = {}) ⇒ Object
37
38
39
40
41
|
# File 'lib/omise/charge.rb', line 37
def transaction(options = {})
if @attributes["transaction"]
@transaction ||= Transaction.retrieve(@attributes["transaction"], options)
end
end
|
#update(attributes = {}) ⇒ Object
27
28
29
|
# File 'lib/omise/charge.rb', line 27
def update(attributes = {})
assign_attributes resource(attributes).patch(attributes)
end
|