Class: Fintoc::V2::AccountVerification

Inherits:
Object
  • Object
show all
Defined in:
lib/fintoc/v2/resources/account_verification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, object:, status:, reason:, transfer_id:, counterparty:, mode:, receipt_url:, transaction_date:, client: nil) ⇒ AccountVerification



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/fintoc/v2/resources/account_verification.rb', line 7

def initialize(
  id:,
  object:,
  status:,
  reason:,
  transfer_id:,
  counterparty:,
  mode:,
  receipt_url:,
  transaction_date:,
  client: nil,
  **
)
  @id = id
  @object = object
  @status = status
  @reason = reason
  @transfer_id = transfer_id
  @counterparty = counterparty
  @mode = mode
  @receipt_url = receipt_url
  @transaction_date = transaction_date
  @client = client
end

Instance Attribute Details

#counterpartyObject (readonly)

Returns the value of attribute counterparty.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def counterparty
  @counterparty
end

#idObject (readonly)

Returns the value of attribute id.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def id
  @id
end

#modeObject (readonly)

Returns the value of attribute mode.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def mode
  @mode
end

#objectObject (readonly)

Returns the value of attribute object.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def object
  @object
end

#reasonObject (readonly)

Returns the value of attribute reason.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def reason
  @reason
end

#receipt_urlObject (readonly)

Returns the value of attribute receipt_url.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def receipt_url
  @receipt_url
end

#statusObject (readonly)

Returns the value of attribute status.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def status
  @status
end

#transaction_dateObject (readonly)

Returns the value of attribute transaction_date.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def transaction_date
  @transaction_date
end

#transfer_idObject (readonly)

Returns the value of attribute transfer_id.



4
5
6
# File 'lib/fintoc/v2/resources/account_verification.rb', line 4

def transfer_id
  @transfer_id
end

Instance Method Details

#failed?Boolean



49
50
51
# File 'lib/fintoc/v2/resources/account_verification.rb', line 49

def failed?
  @status == 'failed'
end

#pending?Boolean



41
42
43
# File 'lib/fintoc/v2/resources/account_verification.rb', line 41

def pending?
  @status == 'pending'
end

#refreshObject



36
37
38
39
# File 'lib/fintoc/v2/resources/account_verification.rb', line 36

def refresh
  fresh_verification = @client..get(@id)
  refresh_from_verification(fresh_verification)
end

#succeeded?Boolean



45
46
47
# File 'lib/fintoc/v2/resources/account_verification.rb', line 45

def succeeded?
  @status == 'succeeded'
end

#to_sObject



32
33
34
# File 'lib/fintoc/v2/resources/account_verification.rb', line 32

def to_s
  "🔍 Account Verification (#{@id}) - #{@status}"
end