Class: FastSpring::Payment
- Inherits:
-
Object
- Object
- FastSpring::Payment
- Defined in:
- lib/fastspring-saasy/payment.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#declined_reason ⇒ Object
readonly
Returns the value of attribute declined_reason.
-
#method_type ⇒ Object
readonly
Returns the value of attribute method_type.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#status_changed ⇒ Object
readonly
Returns the value of attribute status_changed.
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
-
#initialize(details) ⇒ Payment
constructor
A new instance of Payment.
Constructor Details
#initialize(details) ⇒ Payment
Returns a new instance of Payment.
6 7 8 9 10 11 12 |
# File 'lib/fastspring-saasy/payment.rb', line 6 def initialize(details) @status = details.fetch('status') @status_changed = Date.parse(details.fetch('statusChanged')) @declined_reason = details.fetch('declinedReason') @currency = details.fetch('currency') @total = details.fetch('total').to_f end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
3 4 5 |
# File 'lib/fastspring-saasy/payment.rb', line 3 def currency @currency end |
#declined_reason ⇒ Object (readonly)
Returns the value of attribute declined_reason.
3 4 5 |
# File 'lib/fastspring-saasy/payment.rb', line 3 def declined_reason @declined_reason end |
#method_type ⇒ Object (readonly)
Returns the value of attribute method_type.
3 4 5 |
# File 'lib/fastspring-saasy/payment.rb', line 3 def method_type @method_type end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/fastspring-saasy/payment.rb', line 3 def status @status end |
#status_changed ⇒ Object (readonly)
Returns the value of attribute status_changed.
3 4 5 |
# File 'lib/fastspring-saasy/payment.rb', line 3 def status_changed @status_changed end |
#total ⇒ Object (readonly)
Returns the value of attribute total.
3 4 5 |
# File 'lib/fastspring-saasy/payment.rb', line 3 def total @total end |