Class: PensioAPI::ChargebackEvent
- Inherits:
-
Object
- Object
- PensioAPI::ChargebackEvent
- Defined in:
- lib/pensio_api/chargeback_event.rb
Instance Attribute Summary collapse
-
#acquirer_transaction_id ⇒ Object
readonly
Returns the value of attribute acquirer_transaction_id.
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#reason ⇒ Object
readonly
Returns the value of attribute reason.
-
#reason_code ⇒ Object
readonly
Returns the value of attribute reason_code.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #created_at ⇒ Object
-
#initialize(chargeback_body) ⇒ ChargebackEvent
constructor
A new instance of ChargebackEvent.
Constructor Details
#initialize(chargeback_body) ⇒ ChargebackEvent
Returns a new instance of ChargebackEvent.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/pensio_api/chargeback_event.rb', line 10 def initialize(chargeback_body) @raw = chargeback_body @type = @raw['Type'] @reason_code = @raw['ReasonCode'].to_i @reason = @raw['Reason'] @amount = BigDecimal(@raw['Amount']) @currency = @raw['Currency'] @acquirer_transaction_id = @raw['AcquirerTransactionId'] end |
Instance Attribute Details
#acquirer_transaction_id ⇒ Object (readonly)
Returns the value of attribute acquirer_transaction_id.
8 9 10 |
# File 'lib/pensio_api/chargeback_event.rb', line 8 def acquirer_transaction_id @acquirer_transaction_id end |
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
6 7 8 |
# File 'lib/pensio_api/chargeback_event.rb', line 6 def amount @amount end |
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
7 8 9 |
# File 'lib/pensio_api/chargeback_event.rb', line 7 def currency @currency end |
#reason ⇒ Object (readonly)
Returns the value of attribute reason.
5 6 7 |
# File 'lib/pensio_api/chargeback_event.rb', line 5 def reason @reason end |
#reason_code ⇒ Object (readonly)
Returns the value of attribute reason_code.
4 5 6 |
# File 'lib/pensio_api/chargeback_event.rb', line 4 def reason_code @reason_code end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/pensio_api/chargeback_event.rb', line 3 def type @type end |
Instance Method Details
#created_at ⇒ Object
21 22 23 |
# File 'lib/pensio_api/chargeback_event.rb', line 21 def created_at @created_at ||= Time.parse(@raw['Date']) end |