Class: Tikkie::Api::Responses::Payment

Inherits:
Base
  • Object
show all
Defined in:
lib/tikkie/api/responses/payment.rb

Overview

Payment that is associated with a payment request.

Instance Attribute Summary

Attributes inherited from Base

#data, #response

Instance Method Summary collapse

Methods inherited from Base

#error?, #errors, #initialize, #response_code, #success?, #trace_id

Constructor Details

This class inherits a constructor from Tikkie::Api::Responses::Base

Instance Method Details

#amountObject



19
20
21
22
23
# File 'lib/tikkie/api/responses/payment.rb', line 19

def amount
  decimal = BigDecimal.new(data[:amountInCents])
  decimal /= 100.0
  decimal
end

#counter_party_nameObject



15
16
17
# File 'lib/tikkie/api/responses/payment.rb', line 15

def counter_party_name
  data[:counterPartyName]
end

#created_atObject



33
34
35
# File 'lib/tikkie/api/responses/payment.rb', line 33

def created_at
  Time.parse(data[:created]) if data[:created]
end

#currencyObject



25
26
27
# File 'lib/tikkie/api/responses/payment.rb', line 25

def currency
  data[:amountCurrency]
end

#descriptionObject



29
30
31
# File 'lib/tikkie/api/responses/payment.rb', line 29

def description
  data[:description]
end

#online_payment_statusObject

See PaymentStatus



38
39
40
# File 'lib/tikkie/api/responses/payment.rb', line 38

def online_payment_status
  data[:onlinePaymentStatus]
end

#paid?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/tikkie/api/responses/payment.rb', line 42

def paid?
  online_payment_status == Tikkie::Api::Types::PaymentStatus::PAID
end

#payment_tokenObject



11
12
13
# File 'lib/tikkie/api/responses/payment.rb', line 11

def payment_token
  data[:paymentToken]
end