Class: Plaid::PaymentInitiationPayment
- Inherits:
-
Object
- Object
- Plaid::PaymentInitiationPayment
- Defined in:
- lib/plaid/models/payment_initiation_payment.rb
Overview
PaymentInitiationPayment defines a payment initiation payment
Defined Under Namespace
Classes: EnumAttributeValidator
Instance Attribute Summary collapse
-
#adjusted_reference ⇒ Object
The value of the reference sent to the bank after adjustment to pass bank validation rules.
-
#adjusted_scheme ⇒ Object
Returns the value of attribute adjusted_scheme.
-
#amount ⇒ Object
Returns the value of attribute amount.
-
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
-
#bacs ⇒ Object
Returns the value of attribute bacs.
-
#consent_id ⇒ Object
The payment consent ID that this payment was initiated with.
-
#end_to_end_id ⇒ Object
A unique identifier assigned by Plaid to each payment for tracking and reconciliation purposes.
-
#error ⇒ Object
Returns the value of attribute error.
-
#iban ⇒ Object
The International Bank Account Number (IBAN) for the sender, if specified in the ‘/payment_initiation/payment/create` call.
-
#last_status_update ⇒ Object
The date and time of the last time the ‘status` was updated, in IS0 8601 format.
-
#payment_id ⇒ Object
The ID of the payment.
-
#recipient_id ⇒ Object
The ID of the recipient.
-
#reference ⇒ Object
A reference for the payment.
-
#refund_details ⇒ Object
Returns the value of attribute refund_details.
-
#refund_ids ⇒ Object
Refund IDs associated with the payment.
-
#schedule ⇒ Object
Returns the value of attribute schedule.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#status ⇒ Object
Returns the value of attribute status.
-
#transaction_id ⇒ Object
The transaction ID that this payment is associated with, if any.
-
#wallet_id ⇒ Object
The EMI (E-Money Institution) wallet that this payment is associated with, if any.
Class Method Summary collapse
-
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about.
-
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
-
.build_from_hash(attributes) ⇒ Object
Builds the object from hash.
-
.openapi_nullable ⇒ Object
List of attributes with nullable: true.
-
.openapi_types ⇒ Object
Attribute type mapping.
Instance Method Summary collapse
-
#==(o) ⇒ Object
Checks equality by comparing each attribute.
-
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type.
-
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash.
-
#build_from_hash(attributes) ⇒ Object
Builds the object from hash.
- #eql?(o) ⇒ Boolean
-
#hash ⇒ Integer
Calculates hash code according to all attributes.
-
#initialize(attributes = {}) ⇒ PaymentInitiationPayment
constructor
Initializes the object.
-
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons.
-
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility).
-
#to_hash ⇒ Hash
Returns the object in the form of hash.
-
#to_s ⇒ String
Returns the string representation of the object.
-
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid.
Constructor Details
#initialize(attributes = {}) ⇒ PaymentInitiationPayment
Initializes the object
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 170 def initialize(attributes = {}) if (!attributes.is_a?(Hash)) fail ArgumentError, "The input argument (attributes) must be a hash in `Plaid::PaymentInitiationPayment` initialize method" end # check to see if the attribute exists and convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| if (!self.class.attribute_map.key?(k.to_sym)) fail ArgumentError, "`#{k}` is not a valid attribute in `Plaid::PaymentInitiationPayment`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect end h[k.to_sym] = v } if attributes.key?(:'payment_id') self.payment_id = attributes[:'payment_id'] end if attributes.key?(:'amount') self.amount = attributes[:'amount'] end if attributes.key?(:'status') self.status = attributes[:'status'] end if attributes.key?(:'recipient_id') self.recipient_id = attributes[:'recipient_id'] end if attributes.key?(:'reference') self.reference = attributes[:'reference'] end if attributes.key?(:'adjusted_reference') self.adjusted_reference = attributes[:'adjusted_reference'] end if attributes.key?(:'last_status_update') self.last_status_update = attributes[:'last_status_update'] end if attributes.key?(:'schedule') self.schedule = attributes[:'schedule'] end if attributes.key?(:'refund_details') self.refund_details = attributes[:'refund_details'] end if attributes.key?(:'bacs') self.bacs = attributes[:'bacs'] end if attributes.key?(:'iban') self.iban = attributes[:'iban'] end if attributes.key?(:'refund_ids') if (value = attributes[:'refund_ids']).is_a?(Array) self.refund_ids = value end end if attributes.key?(:'amount_refunded') self.amount_refunded = attributes[:'amount_refunded'] end if attributes.key?(:'wallet_id') self.wallet_id = attributes[:'wallet_id'] end if attributes.key?(:'scheme') self.scheme = attributes[:'scheme'] end if attributes.key?(:'adjusted_scheme') self.adjusted_scheme = attributes[:'adjusted_scheme'] end if attributes.key?(:'consent_id') self. = attributes[:'consent_id'] end if attributes.key?(:'transaction_id') self.transaction_id = attributes[:'transaction_id'] end if attributes.key?(:'end_to_end_id') self.end_to_end_id = attributes[:'end_to_end_id'] end if attributes.key?(:'error') self.error = attributes[:'error'] end end |
Instance Attribute Details
#adjusted_reference ⇒ Object
The value of the reference sent to the bank after adjustment to pass bank validation rules.
33 34 35 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 33 def adjusted_reference @adjusted_reference end |
#adjusted_scheme ⇒ Object
Returns the value of attribute adjusted_scheme.
57 58 59 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 57 def adjusted_scheme @adjusted_scheme end |
#amount ⇒ Object
Returns the value of attribute amount.
22 23 24 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 22 def amount @amount end |
#amount_refunded ⇒ Object
Returns the value of attribute amount_refunded.
50 51 52 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 50 def amount_refunded @amount_refunded end |
#bacs ⇒ Object
Returns the value of attribute bacs.
42 43 44 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 42 def bacs @bacs end |
#consent_id ⇒ Object
The payment consent ID that this payment was initiated with. Is present only when payment was initiated using the payment consent.
60 61 62 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 60 def @consent_id end |
#end_to_end_id ⇒ Object
A unique identifier assigned by Plaid to each payment for tracking and reconciliation purposes. Note: Not all banks handle ‘end_to_end_id` consistently. To ensure accurate matching, clients should convert both the incoming `end_to_end_id` and the one provided by Plaid to the same case (either lower or upper) before comparison. For virtual account payments, Plaid manages this field automatically.
66 67 68 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 66 def end_to_end_id @end_to_end_id end |
#error ⇒ Object
Returns the value of attribute error.
68 69 70 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 68 def error @error end |
#iban ⇒ Object
The International Bank Account Number (IBAN) for the sender, if specified in the ‘/payment_initiation/payment/create` call.
45 46 47 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 45 def iban @iban end |
#last_status_update ⇒ Object
The date and time of the last time the ‘status` was updated, in IS0 8601 format
36 37 38 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 36 def last_status_update @last_status_update end |
#payment_id ⇒ Object
The ID of the payment. Like all Plaid identifiers, the ‘payment_id` is case sensitive.
20 21 22 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 20 def payment_id @payment_id end |
#recipient_id ⇒ Object
The ID of the recipient
27 28 29 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 27 def recipient_id @recipient_id end |
#reference ⇒ Object
A reference for the payment.
30 31 32 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 30 def reference @reference end |
#refund_details ⇒ Object
Returns the value of attribute refund_details.
40 41 42 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 40 def refund_details @refund_details end |
#refund_ids ⇒ Object
Refund IDs associated with the payment.
48 49 50 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 48 def refund_ids @refund_ids end |
#schedule ⇒ Object
Returns the value of attribute schedule.
38 39 40 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 38 def schedule @schedule end |
#scheme ⇒ Object
Returns the value of attribute scheme.
55 56 57 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 55 def scheme @scheme end |
#status ⇒ Object
Returns the value of attribute status.
24 25 26 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 24 def status @status end |
#transaction_id ⇒ Object
The transaction ID that this payment is associated with, if any. This is present only when a payment was initiated using virtual accounts.
63 64 65 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 63 def transaction_id @transaction_id end |
#wallet_id ⇒ Object
The EMI (E-Money Institution) wallet that this payment is associated with, if any. This wallet is used as an intermediary account to enable Plaid to reconcile the settlement of funds for Payment Initiation requests.
53 54 55 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 53 def wallet_id @wallet_id end |
Class Method Details
.acceptable_attributes ⇒ Object
Returns all the JSON keys this model knows about
119 120 121 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 119 def self.acceptable_attributes attribute_map.values end |
.attribute_map ⇒ Object
Attribute mapping from ruby-style variable name to JSON key.
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 93 def self.attribute_map { :'payment_id' => :'payment_id', :'amount' => :'amount', :'status' => :'status', :'recipient_id' => :'recipient_id', :'reference' => :'reference', :'adjusted_reference' => :'adjusted_reference', :'last_status_update' => :'last_status_update', :'schedule' => :'schedule', :'refund_details' => :'refund_details', :'bacs' => :'bacs', :'iban' => :'iban', :'refund_ids' => :'refund_ids', :'amount_refunded' => :'amount_refunded', :'wallet_id' => :'wallet_id', :'scheme' => :'scheme', :'adjusted_scheme' => :'adjusted_scheme', :'consent_id' => :'consent_id', :'transaction_id' => :'transaction_id', :'end_to_end_id' => :'end_to_end_id', :'error' => :'error' } end |
.build_from_hash(attributes) ⇒ Object
Builds the object from hash
351 352 353 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 351 def self.build_from_hash(attributes) new.build_from_hash(attributes) end |
.openapi_nullable ⇒ Object
List of attributes with nullable: true
150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 150 def self.openapi_nullable Set.new([ :'adjusted_reference', :'schedule', :'refund_details', :'bacs', :'iban', :'refund_ids', :'wallet_id', :'scheme', :'adjusted_scheme', :'consent_id', :'transaction_id', :'end_to_end_id', :'error' ]) end |
.openapi_types ⇒ Object
Attribute type mapping.
124 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/plaid/models/payment_initiation_payment.rb', line 124 def self.openapi_types { :'payment_id' => :'String', :'amount' => :'PaymentAmount', :'status' => :'PaymentInitiationPaymentStatus', :'recipient_id' => :'String', :'reference' => :'String', :'adjusted_reference' => :'String', :'last_status_update' => :'Time', :'schedule' => :'ExternalPaymentScheduleGet', :'refund_details' => :'ExternalPaymentRefundDetails', :'bacs' => :'SenderBACSNullable', :'iban' => :'String', :'refund_ids' => :'Array<String>', :'amount_refunded' => :'PaymentAmountRefunded', :'wallet_id' => :'String', :'scheme' => :'PaymentScheme', :'adjusted_scheme' => :'PaymentScheme', :'consent_id' => :'String', :'transaction_id' => :'String', :'end_to_end_id' => :'String', :'error' => :'PlaidError' } end |
Instance Method Details
#==(o) ⇒ Object
Checks equality by comparing each attribute.
311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 311 def ==(o) return true if self.equal?(o) self.class == o.class && payment_id == o.payment_id && amount == o.amount && status == o.status && recipient_id == o.recipient_id && reference == o.reference && adjusted_reference == o.adjusted_reference && last_status_update == o.last_status_update && schedule == o.schedule && refund_details == o.refund_details && bacs == o.bacs && iban == o.iban && refund_ids == o.refund_ids && amount_refunded == o.amount_refunded && wallet_id == o.wallet_id && scheme == o.scheme && adjusted_scheme == o.adjusted_scheme && == o. && transaction_id == o.transaction_id && end_to_end_id == o.end_to_end_id && error == o.error end |
#_deserialize(type, value) ⇒ Object
Deserializes the data based on type
382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 382 def _deserialize(type, value) case type.to_sym when :Time Time.parse(value) when :Date Date.parse(value) when :String value.to_s when :Integer value.to_i when :Float value.to_f when :Boolean if value.to_s =~ /\A(true|t|yes|y|1)\z/i true else false end when :Object # generic object (usually a Hash), return directly value when /\AArray<(?<inner_type>.+)>\z/ inner_type = Regexp.last_match[:inner_type] value.map { |v| _deserialize(inner_type, v) } when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/ k_type = Regexp.last_match[:k_type] v_type = Regexp.last_match[:v_type] {}.tap do |hash| value.each do |k, v| hash[_deserialize(k_type, k)] = _deserialize(v_type, v) end end else # model # models (e.g. Pet) or oneOf klass = Plaid.const_get(type) klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value) end end |
#_to_hash(value) ⇒ Hash
Outputs non-array value in the form of hash For object, use to_hash. Otherwise, just return the value
453 454 455 456 457 458 459 460 461 462 463 464 465 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 453 def _to_hash(value) if value.is_a?(Array) value.compact.map { |v| _to_hash(v) } elsif value.is_a?(Hash) {}.tap do |hash| value.each { |k, v| hash[k] = _to_hash(v) } end elsif value.respond_to? :to_hash value.to_hash else value end end |
#build_from_hash(attributes) ⇒ Object
Builds the object from hash
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 358 def build_from_hash(attributes) return nil unless attributes.is_a?(Hash) attributes = attributes.transform_keys(&:to_sym) self.class.openapi_types.each_pair do |key, type| if attributes[self.class.attribute_map[key]].nil? && self.class.openapi_nullable.include?(key) self.send("#{key}=", nil) elsif type =~ /\AArray<(.*)>/i # check to ensure the input is an array given that the attribute # is documented as an array but the input is not if attributes[self.class.attribute_map[key]].is_a?(Array) self.send("#{key}=", attributes[self.class.attribute_map[key]].map { |v| _deserialize($1, v) }) end elsif !attributes[self.class.attribute_map[key]].nil? self.send("#{key}=", _deserialize(type, attributes[self.class.attribute_map[key]])) end end self end |
#eql?(o) ⇒ Boolean
338 339 340 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 338 def eql?(o) self == o end |
#hash ⇒ Integer
Calculates hash code according to all attributes.
344 345 346 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 344 def hash [payment_id, amount, status, recipient_id, reference, adjusted_reference, last_status_update, schedule, refund_details, bacs, iban, refund_ids, amount_refunded, wallet_id, scheme, adjusted_scheme, , transaction_id, end_to_end_id, error].hash end |
#list_invalid_properties ⇒ Object
Show invalid properties with the reasons. Usually used together with valid?
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 268 def list_invalid_properties invalid_properties = Array.new if @payment_id.nil? invalid_properties.push('invalid value for "payment_id", payment_id cannot be nil.') end if @amount.nil? invalid_properties.push('invalid value for "amount", amount cannot be nil.') end if @status.nil? invalid_properties.push('invalid value for "status", status cannot be nil.') end if @recipient_id.nil? invalid_properties.push('invalid value for "recipient_id", recipient_id cannot be nil.') end if @reference.nil? invalid_properties.push('invalid value for "reference", reference cannot be nil.') end if @last_status_update.nil? invalid_properties.push('invalid value for "last_status_update", last_status_update cannot be nil.') end invalid_properties end |
#to_body ⇒ Hash
to_body is an alias to to_hash (backward compatibility)
429 430 431 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 429 def to_body to_hash end |
#to_hash ⇒ Hash
Returns the object in the form of hash
435 436 437 438 439 440 441 442 443 444 445 446 447 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 435 def to_hash hash = {} self.class.attribute_map.each_pair do |attr, param| value = self.send(attr) if value.nil? is_nullable = self.class.openapi_nullable.include?(attr) next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}")) end hash[param] = _to_hash(value) end hash end |
#to_s ⇒ String
Returns the string representation of the object
423 424 425 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 423 def to_s to_hash.to_s end |
#valid? ⇒ Boolean
Check to see if the all the properties in the model are valid
299 300 301 302 303 304 305 306 307 |
# File 'lib/plaid/models/payment_initiation_payment.rb', line 299 def valid? return false if @payment_id.nil? return false if @amount.nil? return false if @status.nil? return false if @recipient_id.nil? return false if @reference.nil? return false if @last_status_update.nil? true end |