Class: Conekta::Return
- Inherits:
-
Resource
- Object
- Hash
- ConektaObject
- Resource
- Conekta::Return
- Defined in:
- lib/conekta/return.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#charge_id ⇒ Object
Returns the value of attribute charge_id.
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#livemode ⇒ Object
Returns the value of attribute livemode.
-
#parent_id ⇒ Object
Returns the value of attribute parent_id.
-
#reason ⇒ Object
Returns the value of attribute reason.
Attributes inherited from Resource
Attributes inherited from ConektaObject
Instance Method Summary collapse
Methods inherited from Resource
_url, #create_member_with_relation, #initialize, underscored_class
Methods inherited from ConektaObject
#class_name, class_name, #create_attr, #first, #initialize, #inspect, #last, #load_from, #set_val, #to_s, #unset_key
Constructor Details
This class inherits a constructor from Conekta::Resource
Instance Attribute Details
#amount ⇒ Object
Returns the value of attribute amount.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def amount @amount end |
#charge_id ⇒ Object
Returns the value of attribute charge_id.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def charge_id @charge_id end |
#created_at ⇒ Object
Returns the value of attribute created_at.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def created_at @created_at end |
#currency ⇒ Object
Returns the value of attribute currency.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def currency @currency end |
#livemode ⇒ Object
Returns the value of attribute livemode.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def livemode @livemode end |
#parent_id ⇒ Object
Returns the value of attribute parent_id.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def parent_id @parent_id end |
#reason ⇒ Object
Returns the value of attribute reason.
4 5 6 |
# File 'lib/conekta/return.rb', line 4 def reason @reason end |
Instance Method Details
#_url ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/conekta/return.rb', line 6 def _url if (id.nil? || id.to_s.empty?) exception = Error.new({ "message" => I18n.t('error.resource.id', { resource: self.class.class_name, locale: :en }), "message_to_purchaser" => I18n.t('error.resource.id_purchaser', { locale: Conekta.locale.to_sym }) }) if Conekta.api_version == "2.0.0" error_list = Conekta::ErrorList.new error_list.details << exception exception = error_list end raise exception end "#{self.order._url}#{self.class._url}/#{id}" end |