Class: ThePlaidApi::WalletTransactionExecuteResponse

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/the_plaid_api/models/wallet_transaction_execute_response.rb

Overview

WalletTransactionExecuteResponse defines the response schema for ‘/wallet/transaction/execute`

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(transaction_id:, status:, request_id:, additional_properties: nil) ⇒ WalletTransactionExecuteResponse

Returns a new instance of WalletTransactionExecuteResponse.



60
61
62
63
64
65
66
67
68
69
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 60

def initialize(transaction_id:, status:, request_id:,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @transaction_id = transaction_id
  @status = status
  @request_id = request_id
  @additional_properties = additional_properties
end

Instance Attribute Details

#request_idString

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Returns:

  • (String)


39
40
41
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 39

def request_id
  @request_id
end

#statusWalletTransactionStatus

The status of the transaction. ‘AUTHORISING`: The transaction is being processed for validation and compliance. `INITIATED`: The transaction has been initiated and is currently being processed. `EXECUTED`: The transaction has been successfully executed and is considered complete. This is only applicable for debit transactions. `SETTLED`: The transaction has settled and funds are available for use. This is only applicable for credit transactions. A transaction will typically settle within seconds to several days, depending on which payment rail is used. `FAILED`: The transaction failed to process successfully. This is a terminal status. `BLOCKED`: The transaction has been blocked for violating compliance rules. This is a terminal status.



33
34
35
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 33

def status
  @status
end

#transaction_idString

A unique ID identifying the transaction

Returns:

  • (String)


15
16
17
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 15

def transaction_id
  @transaction_id
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 72

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  transaction_id =
    hash.key?('transaction_id') ? hash['transaction_id'] : nil
  status = hash.key?('status') ? hash['status'] : nil
  request_id = hash.key?('request_id') ? hash['request_id'] : nil

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  WalletTransactionExecuteResponse.new(transaction_id: transaction_id,
                                       status: status,
                                       request_id: request_id,
                                       additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



42
43
44
45
46
47
48
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 42

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['transaction_id'] = 'transaction_id'
  @_hash['status'] = 'status'
  @_hash['request_id'] = 'request_id'
  @_hash
end

.nullablesObject

An array for nullable fields



56
57
58
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 56

def self.nullables
  []
end

.optionalsObject

An array for optional fields



51
52
53
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 51

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



103
104
105
106
107
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 103

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} transaction_id: #{@transaction_id.inspect}, status: #{@status.inspect},"\
  " request_id: #{@request_id.inspect}, additional_properties: #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



96
97
98
99
100
# File 'lib/the_plaid_api/models/wallet_transaction_execute_response.rb', line 96

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} transaction_id: #{@transaction_id}, status: #{@status}, request_id:"\
  " #{@request_id}, additional_properties: #{@additional_properties}>"
end