Class: PensioAPI::ChargebackEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/pensio_api/chargeback_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_idObject (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

#amountObject (readonly)

Returns the value of attribute amount.



6
7
8
# File 'lib/pensio_api/chargeback_event.rb', line 6

def amount
  @amount
end

#currencyObject (readonly)

Returns the value of attribute currency.



7
8
9
# File 'lib/pensio_api/chargeback_event.rb', line 7

def currency
  @currency
end

#reasonObject (readonly)

Returns the value of attribute reason.



5
6
7
# File 'lib/pensio_api/chargeback_event.rb', line 5

def reason
  @reason
end

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

#typeObject (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_atObject



21
22
23
# File 'lib/pensio_api/chargeback_event.rb', line 21

def created_at
  @created_at ||= Time.parse(@raw['Date'])
end