Class: FastSpring::Payment

Inherits:
Object
  • Object
show all
Defined in:
lib/fastspring-saasy/payment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#currencyObject (readonly)

Returns the value of attribute currency.



3
4
5
# File 'lib/fastspring-saasy/payment.rb', line 3

def currency
  @currency
end

#declined_reasonObject (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_typeObject (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

#statusObject (readonly)

Returns the value of attribute status.



3
4
5
# File 'lib/fastspring-saasy/payment.rb', line 3

def status
  @status
end

#status_changedObject (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

#totalObject (readonly)

Returns the value of attribute total.



3
4
5
# File 'lib/fastspring-saasy/payment.rb', line 3

def total
  @total
end