Class: Paid::Transaction
- Inherits:
-
APIResource
- Object
- APIResource
- Paid::Transaction
- Defined in:
- lib/paid/transaction.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#customer ⇒ Object
Returns the value of attribute customer.
-
#description ⇒ Object
Returns the value of attribute description.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#invoice ⇒ Object
Returns the value of attribute invoice.
-
#metadata ⇒ Object
Returns the value of attribute metadata.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#paid ⇒ Object
Returns the value of attribute paid.
-
#paid_on ⇒ Object
Returns the value of attribute paid_on.
-
#properties ⇒ Object
Returns the value of attribute properties.
-
#rank ⇒ Object
Returns the value of attribute rank.
-
#serviced_on ⇒ Object
Returns the value of attribute serviced_on.
Attributes inherited from APIResource
Class Method Summary collapse
- .all(params = {}, headers = {}) ⇒ Object
- .create(params = {}, headers = {}) ⇒ Object
- .retrieve(id, params = {}, headers = {}) ⇒ Object
Instance Method Summary collapse
- #delete(params = {}, headers = {}) ⇒ Object
- #mark_as_paid(params = {}, headers = {}) ⇒ Object
- #refresh(params = {}, headers = {}) ⇒ Object
- #refunds ⇒ Object
- #save(params = {}, headers = {}) ⇒ Object
Methods inherited from APIResource
add_api_attribute, api_attribute_names, #api_attributes, api_subclass_fetch, api_subclasses, #changed_api_attributes, #clear_api_attributes, determine_api_attribute_value, #determine_api_attribute_value, #initialize, #inspect, #inspect_api_attributes, #inspect_nested, #refresh_from, register_api_subclass, #to_json
Constructor Details
This class inherits a constructor from Paid::APIResource
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
5 6 7 |
# File 'lib/paid/transaction.rb', line 5 def amount @amount end |
#customer ⇒ Object
Returns the value of attribute customer.
7 8 9 |
# File 'lib/paid/transaction.rb', line 7 def customer @customer end |
#description ⇒ Object
Returns the value of attribute description.
6 7 8 |
# File 'lib/paid/transaction.rb', line 6 def description @description end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/paid/transaction.rb', line 3 def id @id end |
#invoice ⇒ Object
Returns the value of attribute invoice.
14 15 16 |
# File 'lib/paid/transaction.rb', line 14 def invoice @invoice end |
#metadata ⇒ Object
Returns the value of attribute metadata.
13 14 15 |
# File 'lib/paid/transaction.rb', line 13 def @metadata end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
4 5 6 |
# File 'lib/paid/transaction.rb', line 4 def object @object end |
#paid ⇒ Object
Returns the value of attribute paid.
8 9 10 |
# File 'lib/paid/transaction.rb', line 8 def paid @paid end |
#paid_on ⇒ Object
Returns the value of attribute paid_on.
9 10 11 |
# File 'lib/paid/transaction.rb', line 9 def paid_on @paid_on end |
#properties ⇒ Object
Returns the value of attribute properties.
10 11 12 |
# File 'lib/paid/transaction.rb', line 10 def properties @properties end |
#rank ⇒ Object
Returns the value of attribute rank.
11 12 13 |
# File 'lib/paid/transaction.rb', line 11 def rank @rank end |
#serviced_on ⇒ Object
Returns the value of attribute serviced_on.
12 13 14 |
# File 'lib/paid/transaction.rb', line 12 def serviced_on @serviced_on end |
Class Method Details
.all(params = {}, headers = {}) ⇒ Object
17 18 19 20 |
# File 'lib/paid/transaction.rb', line 17 def self.all(params={}, headers={}) method = APIMethod.new(:get, "/transactions", params, headers, self) APIList.new(self, method.execute, method) end |
.create(params = {}, headers = {}) ⇒ Object
30 31 32 33 |
# File 'lib/paid/transaction.rb', line 30 def self.create(params={}, headers={}) method = APIMethod.new(:post, "/transactions", params, headers, self) self.new(method.execute, method) end |
.retrieve(id, params = {}, headers = {}) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/paid/transaction.rb', line 22 def self.retrieve(id, params={}, headers={}) params = ParamsBuilder.merge(params, { :id => id }) method = APIMethod.new(:get, "/transactions/:id", params, headers, self) self.new(method.execute, method) end |
Instance Method Details
#delete(params = {}, headers = {}) ⇒ Object
46 47 48 49 |
# File 'lib/paid/transaction.rb', line 46 def delete(params={}, headers={}) method = APIMethod.new(:delete, "/transactions/:id", params, headers, self) self.refresh_from(method.execute, method) end |
#mark_as_paid(params = {}, headers = {}) ⇒ Object
51 52 53 54 |
# File 'lib/paid/transaction.rb', line 51 def mark_as_paid(params={}, headers={}) method = APIMethod.new(:post, "/transactions/:id/mark_as_paid", params, headers, self) self.refresh_from(method.execute, method) end |
#refresh(params = {}, headers = {}) ⇒ Object
35 36 37 38 |
# File 'lib/paid/transaction.rb', line 35 def refresh(params={}, headers={}) method = APIMethod.new(:get, "/transactions/:id", params, headers, self) self.refresh_from(method.execute, method) end |
#refunds ⇒ Object
56 57 58 |
# File 'lib/paid/transaction.rb', line 56 def refunds RefundList.new(nil, nil, id) end |
#save(params = {}, headers = {}) ⇒ Object
40 41 42 43 44 |
# File 'lib/paid/transaction.rb', line 40 def save(params={}, headers={}) params = ParamsBuilder.merge(params, changed_api_attributes) method = APIMethod.new(:put, "/transactions/:id", params, headers, self) self.refresh_from(method.execute, method) end |