Class: ThePlaidApi::PaymentInitiationConsentPaymentExecuteResponse

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

Overview

PaymentInitiationConsentPaymentExecuteResponse defines the response schema for ‘/payment_initiation/consent/payment/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(payment_id:, status:, request_id:, error: SKIP, additional_properties: nil) ⇒ PaymentInitiationConsentPaymentExecuteResponse

Returns a new instance of PaymentInitiationConsentPaymentExecuteResponse.



112
113
114
115
116
117
118
119
120
121
122
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 112

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

  @payment_id = payment_id
  @status = status
  @request_id = request_id
  @error = error unless error == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#errorError

Errors are identified by ‘error_code` and categorized by `error_type`. Use these in preference to HTTP status codes to identify and handle specific errors. HTTP status codes are set and provide the broadest categorization of errors: 4xx codes are for developer- or user-related errors, and 5xx codes are for Plaid-related errors, and the status will be 2xx in non-error cases. An Item with a non-`null` error object will only be part of an API response when calling `/item/get` to view Item status. Otherwise, error fields will be `null` if no error has occurred; if an error has occurred, an error code will be returned instead.

Returns:



86
87
88
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 86

def error
  @error
end

#payment_idString

A unique ID identifying the payment

Returns:

  • (String)


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

def payment_id
  @payment_id
end

#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)


74
75
76
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 74

def request_id
  @request_id
end

#statusPaymentInitiationPaymentStatus

The status of the payment. Core lifecycle statuses: **‘PAYMENT_STATUS_INPUT_NEEDED`**: Transitional. The payment is awaiting user input to continue processing. It may re-enter this state if additional input is required. **`PAYMENT_STATUS_AUTHORISING`:** Transitional. The payment is being authorised by the financial institution. It will automatically move on once authorisation completes. **`PAYMENT_STATUS_INITIATED`:** The payment has been authorised and accepted by the financial institution. In many EU markets, `PAYMENT_STATUS_EXECUTED` is not supported, and a payment will remain in `PAYMENT_STATUS_INITIATED` until the funds settle, making this a terminal success state in those cases. A payment in `PAYMENT_STATUS_INITIATED` should be treated as a successfully submitted payment; do not gate downstream processing on reaching `PAYMENT_STATUS_EXECUTED`. For a full explanation of payment statuses and how to handle each, see the [Payment Status guide](plaid.com/docs/payment-initiation/payment-status/). **`PAYMENT_STATUS_EXECUTED`: Terminal.** The funds have left the payer’s account and the payment is en route to settlement. Note that this status does not confirm that funds have arrived in the recipient’s account; do not use it as proof of fund receipt. Support is more common in the UK than in the EU; where unsupported, a successful payment remains in `PAYMENT_STATUS_INITIATED` before settling. When using Plaid Virtual Accounts, `PAYMENT_STATUS_EXECUTED` is not terminal—the payment will continue to `PAYMENT_STATUS_SETTLED` once funds are available. **`PAYMENT_STATUS_SETTLED`: Terminal.** The funds are available in the recipient’s account. Only available to customers using [Plaid Virtual Accounts](plaid.com/docs/payment-initiation/virtual-accounts/). Failure statuses: **`PAYMENT_STATUS_INSUFFICIENT_FUNDS`: Terminal.** The payment failed due to insufficient funds. No further retries will succeed until the payer’s balance is replenished. **`PAYMENT_STATUS_FAILED`: Terminal (retryable).** The payment could not be initiated due to a system error or outage. Retry once the root cause is resolved. **`PAYMENT_STATUS_BLOCKED`: Terminal (retryable).** The payment was blocked by Plaid (e.g., flagged as risky). Resolve any compliance or risk issues and retry. **`PAYMENT_STATUS_REJECTED`: Terminal.** The payment was rejected by the financial institution. No automatic retry is possible. **`PAYMENT_STATUS_CANCELLED`: Terminal.** The end user cancelled the payment during authorisation. Standing-order statuses: **`PAYMENT_STATUS_ESTABLISHED`: Terminal.** A recurring/standing order has been successfully created. Deprecated (to be removed in a future release): `PAYMENT_STATUS_UNKNOWN`: The payment status is unknown. `PAYMENT_STATUS_PROCESSING`: The payment is currently being processed. `PAYMENT_STATUS_COMPLETED`: Indicates that the standing order has been successfully established.



68
69
70
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 68

def status
  @status
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 125

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  payment_id = hash.key?('payment_id') ? hash['payment_id'] : nil
  status = hash.key?('status') ? hash['status'] : nil
  request_id = hash.key?('request_id') ? hash['request_id'] : nil
  error = Error.from_hash(hash['error']) if hash['error']

  # 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.
  PaymentInitiationConsentPaymentExecuteResponse.new(payment_id: payment_id,
                                                     status: status,
                                                     request_id: request_id,
                                                     error: error,
                                                     additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



89
90
91
92
93
94
95
96
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 89

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

.nullablesObject

An array for nullable fields



106
107
108
109
110
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 106

def self.nullables
  %w[
    error
  ]
end

.optionalsObject

An array for optional fields



99
100
101
102
103
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 99

def self.optionals
  %w[
    error
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



157
158
159
160
161
162
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 157

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

#to_sObject

Provides a human-readable string representation of the object.



150
151
152
153
154
# File 'lib/the_plaid_api/models/payment_initiation_consent_payment_execute_response.rb', line 150

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