Class: ThePlaidApi::Transaction
- Defined in:
- lib/the_plaid_api/models/transaction.rb
Overview
A representation of a transaction
Instance Attribute Summary collapse
-
#account_id ⇒ String
The ID of the account in which this transaction occurred.
-
#account_owner ⇒ String
This field is not typically populated and only relevant when dealing with sub-accounts.
-
#amount ⇒ Float
The settled value of the transaction, denominated in the transactions’s currency, as stated in ‘iso_currency_code` or `unofficial_currency_code`.
-
#authorized_date ⇒ Date
The date that the transaction was authorized.
-
#authorized_datetime ⇒ DateTime
Date and time when a transaction was authorized in [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DDTHH:mm:ssZ` ).
-
#business_finance_category ⇒ BusinessFinanceCategory
Information describing the intent of the transaction.
-
#category ⇒ Array[String]
A hierarchical array of the categories to which this transaction belongs.
-
#category_id ⇒ String
The ID of the category to which this transaction belongs.
-
#check_number ⇒ String
The check number of the transaction.
-
#client_customization ⇒ ClientCustomization
Custom client fields.
-
#counterparties ⇒ Array[Counterparty]
The counterparties present in the transaction.
-
#date ⇒ Date
For pending transactions, the date that the transaction occurred; for posted transactions, the date that the transaction posted.
-
#datetime ⇒ DateTime
Date and time when a transaction was posted in [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DDTHH:mm:ssZ` ).
-
#iso_currency_code ⇒ String
The ISO-4217 currency code of the transaction.
-
#location ⇒ TransactionLocation
A representation of where a transaction took place.
-
#logo_url ⇒ String
The URL of a logo associated with this transaction, if available.
-
#merchant_entity_id ⇒ String
A unique, stable, Plaid-generated ID that maps to the merchant.
-
#merchant_name ⇒ String
The merchant name, as enriched by Plaid from the ‘name` field.
-
#name ⇒ String
The merchant name or transaction description.
-
#original_description ⇒ String
The string returned by the financial institution to describe the transaction.
-
#payment_channel ⇒ PaymentChannel
The channel used to make a payment.
-
#payment_meta ⇒ PaymentMeta
Transaction information specific to inter-bank transfers.
-
#pending ⇒ TrueClass | FalseClass
When ‘true`, identifies the transaction as pending or unsettled.
-
#pending_transaction_id ⇒ String
The ID of a posted transaction’s associated pending transaction, where applicable.
-
#personal_finance_category ⇒ PersonalFinanceCategory
Information describing the intent of the transaction.
-
#personal_finance_category_icon_url ⇒ String
The URL of an icon associated with the primary personal finance category.
-
#transaction_code ⇒ TransactionCode
An identifier classifying the transaction type.
-
#transaction_id ⇒ String
The unique ID of the transaction.
-
#transaction_type ⇒ TransactionType
Please use the ‘payment_channel` field, `transaction_type` will be deprecated in the future.
-
#unofficial_currency_code ⇒ String
The unofficial currency code associated with the transaction.
-
#website ⇒ String
The website associated with this transaction, if available.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
Instance Method Summary collapse
-
#initialize(account_id:, amount:, iso_currency_code:, unofficial_currency_code:, date:, location:, name:, payment_meta:, pending:, pending_transaction_id:, account_owner:, transaction_id:, authorized_date:, authorized_datetime:, datetime:, payment_channel:, transaction_code:, category: SKIP, category_id: SKIP, check_number: SKIP, merchant_name: SKIP, original_description: SKIP, transaction_type: SKIP, logo_url: SKIP, website: SKIP, personal_finance_category: SKIP, business_finance_category: SKIP, personal_finance_category_icon_url: SKIP, counterparties: SKIP, merchant_entity_id: SKIP, client_customization: SKIP, additional_properties: nil) ⇒ Transaction
constructor
A new instance of Transaction.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
- #to_custom_authorized_datetime ⇒ Object
- #to_custom_datetime ⇒ Object
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(account_id:, amount:, iso_currency_code:, unofficial_currency_code:, date:, location:, name:, payment_meta:, pending:, pending_transaction_id:, account_owner:, transaction_id:, authorized_date:, authorized_datetime:, datetime:, payment_channel:, transaction_code:, category: SKIP, category_id: SKIP, check_number: SKIP, merchant_name: SKIP, original_description: SKIP, transaction_type: SKIP, logo_url: SKIP, website: SKIP, personal_finance_category: SKIP, business_finance_category: SKIP, personal_finance_category_icon_url: SKIP, counterparties: SKIP, merchant_entity_id: SKIP, client_customization: SKIP, additional_properties: nil) ⇒ Transaction
Returns a new instance of Transaction.
358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 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 |
# File 'lib/the_plaid_api/models/transaction.rb', line 358 def initialize(account_id:, amount:, iso_currency_code:, unofficial_currency_code:, date:, location:, name:, payment_meta:, pending:, pending_transaction_id:, account_owner:, transaction_id:, authorized_date:, authorized_datetime:, datetime:, payment_channel:, transaction_code:, category: SKIP, category_id: SKIP, check_number: SKIP, merchant_name: SKIP, original_description: SKIP, transaction_type: SKIP, logo_url: SKIP, website: SKIP, personal_finance_category: SKIP, business_finance_category: SKIP, personal_finance_category_icon_url: SKIP, counterparties: SKIP, merchant_entity_id: SKIP, client_customization: SKIP, additional_properties: nil) # Add additional model properties to the instance additional_properties = {} if additional_properties.nil? @account_id = account_id @amount = amount @iso_currency_code = iso_currency_code @unofficial_currency_code = unofficial_currency_code @category = category unless category == SKIP @category_id = category_id unless category_id == SKIP @check_number = check_number unless check_number == SKIP @date = date @location = location @name = name @merchant_name = merchant_name unless merchant_name == SKIP @original_description = original_description unless original_description == SKIP @payment_meta = @pending = pending @pending_transaction_id = pending_transaction_id @account_owner = account_owner @transaction_id = transaction_id @transaction_type = transaction_type unless transaction_type == SKIP @logo_url = logo_url unless logo_url == SKIP @website = website unless website == SKIP @authorized_date = @authorized_datetime = @datetime = datetime @payment_channel = payment_channel unless personal_finance_category == SKIP @personal_finance_category = personal_finance_category end unless business_finance_category == SKIP @business_finance_category = business_finance_category end @transaction_code = transaction_code unless personal_finance_category_icon_url == SKIP @personal_finance_category_icon_url = personal_finance_category_icon_url end @counterparties = counterparties unless counterparties == SKIP @merchant_entity_id = merchant_entity_id unless merchant_entity_id == SKIP @client_customization = client_customization unless client_customization == SKIP @additional_properties = additional_properties end |
Instance Attribute Details
#account_id ⇒ String
The ID of the account in which this transaction occurred.
15 16 17 |
# File 'lib/the_plaid_api/models/transaction.rb', line 15 def account_id @account_id end |
#account_owner ⇒ String
This field is not typically populated and only relevant when dealing with sub-accounts. A sub-account most commonly exists in cases where a single account is linked to multiple cards, each with its own card number and card holder name; each card will be considered a sub-account. If the account does have sub-accounts, this field will typically be some combination of the sub-account owner’s name and/or the sub-account mask. The format of this field is not standardized and will vary based on institution.
148 149 150 |
# File 'lib/the_plaid_api/models/transaction.rb', line 148 def account_owner @account_owner end |
#amount ⇒ Float
The settled value of the transaction, denominated in the transactions’s currency, as stated in ‘iso_currency_code` or `unofficial_currency_code`. For all products except Income: Positive values when money moves out of the account; negative values when money moves in. For example, debit card purchases are positive; credit card payments, direct deposits, and refunds are negative. For Income endpoints, values are positive when representing income.
25 26 27 |
# File 'lib/the_plaid_api/models/transaction.rb', line 25 def amount @amount end |
#authorized_date ⇒ Date
The date that the transaction was authorized. For posted transactions, the ‘date` field will indicate the posted date, but `authorized_date` will indicate the day the transaction was authorized by the financial institution. If presenting transactions to the user in a UI, the `authorized_date`, when available, is generally preferable to use over the `date` field for posted transactions, as it will generally represent the date the user actually made the transaction. Dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( `YYYY-MM-DD` ).
182 183 184 |
# File 'lib/the_plaid_api/models/transaction.rb', line 182 def @authorized_date end |
#authorized_datetime ⇒ DateTime
Date and time when a transaction was authorized in [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DDTHH:mm:ssZ` ). For posted transactions, the `datetime` field will indicate the posted date, but `authorized_datetime` will indicate the day the transaction was authorized by the financial institution. If presenting transactions to the user in a UI, the `authorized_datetime`, when available, is generally preferable to use over the `datetime` field for posted transactions, as it will generally represent the date the user actually made the transaction. This field is returned for select financial institutions and comes as provided by the institution. It may contain default time values (such as 00:00:00). This field is only populated in API version 2019-05-29 and later.
197 198 199 |
# File 'lib/the_plaid_api/models/transaction.rb', line 197 def @authorized_datetime end |
#business_finance_category ⇒ BusinessFinanceCategory
Information describing the intent of the transaction. Most relevant for business finance use cases, but not limited to such use cases.
231 232 233 |
# File 'lib/the_plaid_api/models/transaction.rb', line 231 def business_finance_category @business_finance_category end |
#category ⇒ Array[String]
A hierarchical array of the categories to which this transaction belongs. For a full list of categories, see [‘/categories/get`](plaid.com/docs/api/products/transactions/#cate goriesget). All Transactions implementations are recommended to use the new `personal_finance_category` instead of `category`, as it provides greater accuracy and more meaningful categorization. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
53 54 55 |
# File 'lib/the_plaid_api/models/transaction.rb', line 53 def category @category end |
#category_id ⇒ String
The ID of the category to which this transaction belongs. For a full list of categories, see [‘/categories/get`](plaid.com/docs/api/products/transactions/#cate goriesget). All Transactions implementations are recommended to use the new `personal_finance_category` instead of `category`, as it provides greater accuracy and more meaningful categorization. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
66 67 68 |
# File 'lib/the_plaid_api/models/transaction.rb', line 66 def category_id @category_id end |
#check_number ⇒ String
The check number of the transaction. This field is only populated for check transactions.
71 72 73 |
# File 'lib/the_plaid_api/models/transaction.rb', line 71 def check_number @check_number end |
#client_customization ⇒ ClientCustomization
Custom client fields
273 274 275 |
# File 'lib/the_plaid_api/models/transaction.rb', line 273 def client_customization @client_customization end |
#counterparties ⇒ Array[Counterparty]
The counterparties present in the transaction. Counterparties, such as the merchant or the financial institution, are extracted by Plaid from the raw description.
263 264 265 |
# File 'lib/the_plaid_api/models/transaction.rb', line 263 def counterparties @counterparties end |
#date ⇒ Date
For pending transactions, the date that the transaction occurred; for posted transactions, the date that the transaction posted. Both dates are returned in an [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DD` ). To receive information about the date that a posted transaction was initiated, see the `authorized_date` field.
79 80 81 |
# File 'lib/the_plaid_api/models/transaction.rb', line 79 def date @date end |
#datetime ⇒ DateTime
Date and time when a transaction was posted in [ISO 8601](wikipedia.org/wiki/ISO_8601) format ( ‘YYYY-MM-DDTHH:mm:ssZ` ). For the date that the transaction was initiated, rather than posted, see the `authorized_datetime` field. This field is returned for select financial institutions and comes as provided by the institution. It may contain default time values (such as 00:00:00). This field is only populated in API version 2019-05-29 and later.
208 209 210 |
# File 'lib/the_plaid_api/models/transaction.rb', line 208 def datetime @datetime end |
#iso_currency_code ⇒ String
The ISO-4217 currency code of the transaction. Always ‘null` if `unofficial_currency_code` is non-null.
30 31 32 |
# File 'lib/the_plaid_api/models/transaction.rb', line 30 def iso_currency_code @iso_currency_code end |
#location ⇒ TransactionLocation
A representation of where a transaction took place. Location data is provided only for transactions at physical locations, not for online transactions. Location data availability depends primarily on the merchant and is most likely to be populated for transactions at large retail chains; small, local businesses are less likely to have location data available.
88 89 90 |
# File 'lib/the_plaid_api/models/transaction.rb', line 88 def location @location end |
#logo_url ⇒ String
The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file.
167 168 169 |
# File 'lib/the_plaid_api/models/transaction.rb', line 167 def logo_url @logo_url end |
#merchant_entity_id ⇒ String
A unique, stable, Plaid-generated ID that maps to the merchant. In the case of a merchant with multiple retail locations, this field will map to the broader merchant, not a specific location or store.
269 270 271 |
# File 'lib/the_plaid_api/models/transaction.rb', line 269 def merchant_entity_id @merchant_entity_id end |
#merchant_name ⇒ String
The merchant name, as enriched by Plaid from the ‘name` field. This is typically a more human-readable version of the merchant counterparty in the transaction. For some bank transactions (such as checks or account transfers) where there is no meaningful merchant name, this value will be `null`.
108 109 110 |
# File 'lib/the_plaid_api/models/transaction.rb', line 108 def merchant_name @merchant_name end |
#name ⇒ String
The merchant name or transaction description. Note: While Plaid does not currently plan to remove this field, it is a legacy field that is not actively maintained. Use ‘merchant_name` instead for the merchant name. If the `transactions` object was returned by a Transactions endpoint such as `/transactions/sync` or `/transactions/get`, this field will always appear. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
100 101 102 |
# File 'lib/the_plaid_api/models/transaction.rb', line 100 def name @name end |
#original_description ⇒ String
The string returned by the financial institution to describe the transaction. For transactions returned by ‘/transactions/sync` or `/transactions/get`, this field will only be included if the client has set `options.include_original_description` to `true`.
115 116 117 |
# File 'lib/the_plaid_api/models/transaction.rb', line 115 def original_description @original_description end |
#payment_channel ⇒ PaymentChannel
The channel used to make a payment. ‘online:` transactions that took place online. `in store:` transactions that were made at a physical location. `other:` transactions that relate to banks, e.g. fees or deposits. This field replaces the `transaction_type` field.
216 217 218 |
# File 'lib/the_plaid_api/models/transaction.rb', line 216 def payment_channel @payment_channel end |
#payment_meta ⇒ PaymentMeta
Transaction information specific to inter-bank transfers. If the transaction was not an inter-bank transfer, all fields will be ‘null`. If the `transactions` object was returned by a Transactions endpoint such as `/transactions/sync` or `/transactions/get`, the `payment_meta` key will always appear, but no data elements are guaranteed. If the `transactions` object was returned by an Assets endpoint such as `/asset_report/get/` or `/asset_report/pdf/get`, this field will only appear in an Asset Report with Insights.
126 127 128 |
# File 'lib/the_plaid_api/models/transaction.rb', line 126 def @payment_meta end |
#pending ⇒ TrueClass | FalseClass
When ‘true`, identifies the transaction as pending or unsettled. Pending transaction details (name, type, amount, category ID) may change before they are settled. Not all institutions provide pending transactions.
132 133 134 |
# File 'lib/the_plaid_api/models/transaction.rb', line 132 def pending @pending end |
#pending_transaction_id ⇒ String
The ID of a posted transaction’s associated pending transaction, where applicable. Not all institutions provide pending transactions.
137 138 139 |
# File 'lib/the_plaid_api/models/transaction.rb', line 137 def pending_transaction_id @pending_transaction_id end |
#personal_finance_category ⇒ PersonalFinanceCategory
Information describing the intent of the transaction. Most relevant for personal finance use cases, but not limited to such use cases. See the [taxonomy CSV file](plaid.com/documents/pfc-taxonomy-all.csv) for a full list of personal finance categories. If you are migrating to personal finance categories from the legacy categories, also refer to the [migration guide](plaid.com/docs/transactions/pfc-migration/).
226 227 228 |
# File 'lib/the_plaid_api/models/transaction.rb', line 226 def personal_finance_category @personal_finance_category end |
#personal_finance_category_icon_url ⇒ String
The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file.
257 258 259 |
# File 'lib/the_plaid_api/models/transaction.rb', line 257 def personal_finance_category_icon_url @personal_finance_category_icon_url end |
#transaction_code ⇒ TransactionCode
An identifier classifying the transaction type. This field is only populated for European institutions. For institutions in the US and Canada, this field is set to ‘null`. `adjustment:` Bank adjustment `atm:` Cash deposit or withdrawal via an automated teller machine `bank charge:` Charge or fee levied by the institution `bill payment`: Payment of a bill `cash:` Cash deposit or withdrawal `cashback:` Cash withdrawal while making a debit card purchase `cheque:` Document ordering the payment of money to another person or organization `direct debit:` Automatic withdrawal of funds initiated by a third party at a regular interval `interest:` Interest earned or incurred `purchase:` Purchase made with a debit or credit card `standing order:` Payment instructed by the account holder to a third party at a regular interval `transfer:` Transfer of money between accounts
252 253 254 |
# File 'lib/the_plaid_api/models/transaction.rb', line 252 def transaction_code @transaction_code end |
#transaction_id ⇒ String
The unique ID of the transaction. Like all Plaid identifiers, the ‘transaction_id` is case sensitive.
153 154 155 |
# File 'lib/the_plaid_api/models/transaction.rb', line 153 def transaction_id @transaction_id end |
#transaction_type ⇒ TransactionType
Please use the ‘payment_channel` field, `transaction_type` will be deprecated in the future. `digital:` transactions that took place online. `place:` transactions that were made at a physical location. `special:` transactions that relate to banks, e.g. fees or deposits. `unresolved:` transactions that do not fit into the other three types.
162 163 164 |
# File 'lib/the_plaid_api/models/transaction.rb', line 162 def transaction_type @transaction_type end |
#unofficial_currency_code ⇒ String
The unofficial currency code associated with the transaction. Always ‘null` if `iso_currency_code` is non-`null`. Unofficial currency codes are used for currencies that do not have official ISO currency codes, such as cryptocurrencies and the currencies of certain countries. See the [currency code schema](plaid.com/docs/api/accounts#currency-code-schema) for a full listing of supported `iso_currency_code`s.
40 41 42 |
# File 'lib/the_plaid_api/models/transaction.rb', line 40 def unofficial_currency_code @unofficial_currency_code end |
#website ⇒ String
The website associated with this transaction, if available.
171 172 173 |
# File 'lib/the_plaid_api/models/transaction.rb', line 171 def website @website end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 |
# File 'lib/the_plaid_api/models/transaction.rb', line 419 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. account_id = hash.key?('account_id') ? hash['account_id'] : nil amount = hash.key?('amount') ? hash['amount'] : nil iso_currency_code = hash.key?('iso_currency_code') ? hash['iso_currency_code'] : nil unofficial_currency_code = hash.key?('unofficial_currency_code') ? hash['unofficial_currency_code'] : nil date = hash.key?('date') ? hash['date'] : nil location = TransactionLocation.from_hash(hash['location']) if hash['location'] name = hash.key?('name') ? hash['name'] : nil = PaymentMeta.from_hash(hash['payment_meta']) if hash['payment_meta'] pending = hash.key?('pending') ? hash['pending'] : nil pending_transaction_id = hash.key?('pending_transaction_id') ? hash['pending_transaction_id'] : nil account_owner = hash.key?('account_owner') ? hash['account_owner'] : nil transaction_id = hash.key?('transaction_id') ? hash['transaction_id'] : nil = hash.key?('authorized_date') ? hash['authorized_date'] : nil = if hash.key?('authorized_datetime') (DateTimeHelper.from_rfc3339(hash['authorized_datetime']) if hash['authorized_datetime']) end datetime = if hash.key?('datetime') (DateTimeHelper.from_rfc3339(hash['datetime']) if hash['datetime']) end payment_channel = hash.key?('payment_channel') ? hash['payment_channel'] : nil transaction_code = hash.key?('transaction_code') ? hash['transaction_code'] : nil category = hash.key?('category') ? hash['category'] : SKIP category_id = hash.key?('category_id') ? hash['category_id'] : SKIP check_number = hash.key?('check_number') ? hash['check_number'] : SKIP merchant_name = hash.key?('merchant_name') ? hash['merchant_name'] : SKIP original_description = hash.key?('original_description') ? hash['original_description'] : SKIP transaction_type = hash.key?('transaction_type') ? hash['transaction_type'] : SKIP logo_url = hash.key?('logo_url') ? hash['logo_url'] : SKIP website = hash.key?('website') ? hash['website'] : SKIP if hash['personal_finance_category'] personal_finance_category = PersonalFinanceCategory.from_hash(hash['personal_finance_category']) end if hash['business_finance_category'] business_finance_category = BusinessFinanceCategory.from_hash(hash['business_finance_category']) end personal_finance_category_icon_url = hash.key?('personal_finance_category_icon_url') ? hash['personal_finance_category_icon_url'] : SKIP # Parameter is an array, so we need to iterate through it counterparties = nil unless hash['counterparties'].nil? counterparties = [] hash['counterparties'].each do |structure| counterparties << (Counterparty.from_hash(structure) if structure) end end counterparties = SKIP unless hash.key?('counterparties') merchant_entity_id = hash.key?('merchant_entity_id') ? hash['merchant_entity_id'] : SKIP client_customization = ClientCustomization.from_hash(hash['client_customization']) if hash['client_customization'] # 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. Transaction.new(account_id: account_id, amount: amount, iso_currency_code: iso_currency_code, unofficial_currency_code: unofficial_currency_code, date: date, location: location, name: name, payment_meta: , pending: pending, pending_transaction_id: pending_transaction_id, account_owner: account_owner, transaction_id: transaction_id, authorized_date: , authorized_datetime: , datetime: datetime, payment_channel: payment_channel, transaction_code: transaction_code, category: category, category_id: category_id, check_number: check_number, merchant_name: merchant_name, original_description: original_description, transaction_type: transaction_type, logo_url: logo_url, website: website, personal_finance_category: personal_finance_category, business_finance_category: business_finance_category, personal_finance_category_icon_url: personal_finance_category_icon_url, counterparties: counterparties, merchant_entity_id: merchant_entity_id, client_customization: client_customization, additional_properties: additional_properties) end |
.names ⇒ Object
A mapping from model property names to API property names.
276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 |
# File 'lib/the_plaid_api/models/transaction.rb', line 276 def self.names @_hash = {} if @_hash.nil? @_hash['account_id'] = 'account_id' @_hash['amount'] = 'amount' @_hash['iso_currency_code'] = 'iso_currency_code' @_hash['unofficial_currency_code'] = 'unofficial_currency_code' @_hash['category'] = 'category' @_hash['category_id'] = 'category_id' @_hash['check_number'] = 'check_number' @_hash['date'] = 'date' @_hash['location'] = 'location' @_hash['name'] = 'name' @_hash['merchant_name'] = 'merchant_name' @_hash['original_description'] = 'original_description' @_hash['payment_meta'] = 'payment_meta' @_hash['pending'] = 'pending' @_hash['pending_transaction_id'] = 'pending_transaction_id' @_hash['account_owner'] = 'account_owner' @_hash['transaction_id'] = 'transaction_id' @_hash['transaction_type'] = 'transaction_type' @_hash['logo_url'] = 'logo_url' @_hash['website'] = 'website' @_hash['authorized_date'] = 'authorized_date' @_hash['authorized_datetime'] = 'authorized_datetime' @_hash['datetime'] = 'datetime' @_hash['payment_channel'] = 'payment_channel' @_hash['personal_finance_category'] = 'personal_finance_category' @_hash['business_finance_category'] = 'business_finance_category' @_hash['transaction_code'] = 'transaction_code' @_hash['personal_finance_category_icon_url'] = 'personal_finance_category_icon_url' @_hash['counterparties'] = 'counterparties' @_hash['merchant_entity_id'] = 'merchant_entity_id' @_hash['client_customization'] = 'client_customization' @_hash end |
.nullables ⇒ Object
An array for nullable fields
334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 |
# File 'lib/the_plaid_api/models/transaction.rb', line 334 def self.nullables %w[ iso_currency_code unofficial_currency_code category category_id check_number merchant_name original_description pending_transaction_id account_owner logo_url website authorized_date authorized_datetime datetime personal_finance_category business_finance_category transaction_code merchant_entity_id client_customization ] end |
.optionals ⇒ Object
An array for optional fields
314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 |
# File 'lib/the_plaid_api/models/transaction.rb', line 314 def self.optionals %w[ category category_id check_number merchant_name original_description transaction_type logo_url website personal_finance_category business_finance_category personal_finance_category_icon_url counterparties merchant_entity_id client_customization ] end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 |
# File 'lib/the_plaid_api/models/transaction.rb', line 555 def inspect class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id.inspect}, amount: #{@amount.inspect},"\ " iso_currency_code: #{@iso_currency_code.inspect}, unofficial_currency_code:"\ " #{@unofficial_currency_code.inspect}, category: #{@category.inspect}, category_id:"\ " #{@category_id.inspect}, check_number: #{@check_number.inspect}, date: #{@date.inspect},"\ " location: #{@location.inspect}, name: #{@name.inspect}, merchant_name:"\ " #{@merchant_name.inspect}, original_description: #{@original_description.inspect},"\ " payment_meta: #{@payment_meta.inspect}, pending: #{@pending.inspect},"\ " pending_transaction_id: #{@pending_transaction_id.inspect}, account_owner:"\ " #{@account_owner.inspect}, transaction_id: #{@transaction_id.inspect}, transaction_type:"\ " #{@transaction_type.inspect}, logo_url: #{@logo_url.inspect}, website:"\ " #{@website.inspect}, authorized_date: #{@authorized_date.inspect}, authorized_datetime:"\ " #{@authorized_datetime.inspect}, datetime: #{@datetime.inspect}, payment_channel:"\ " #{@payment_channel.inspect}, personal_finance_category:"\ " #{@personal_finance_category.inspect}, business_finance_category:"\ " #{@business_finance_category.inspect}, transaction_code: #{@transaction_code.inspect},"\ " personal_finance_category_icon_url: #{@personal_finance_category_icon_url.inspect},"\ " counterparties: #{@counterparties.inspect}, merchant_entity_id:"\ " #{@merchant_entity_id.inspect}, client_customization: #{@client_customization.inspect},"\ " additional_properties: #{@additional_properties}>" end |
#to_custom_authorized_datetime ⇒ Object
526 527 528 |
# File 'lib/the_plaid_api/models/transaction.rb', line 526 def DateTimeHelper.to_rfc3339() end |
#to_custom_datetime ⇒ Object
530 531 532 |
# File 'lib/the_plaid_api/models/transaction.rb', line 530 def to_custom_datetime DateTimeHelper.to_rfc3339(datetime) end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 |
# File 'lib/the_plaid_api/models/transaction.rb', line 535 def to_s class_name = self.class.name.split('::').last "<#{class_name} account_id: #{@account_id}, amount: #{@amount}, iso_currency_code:"\ " #{@iso_currency_code}, unofficial_currency_code: #{@unofficial_currency_code}, category:"\ " #{@category}, category_id: #{@category_id}, check_number: #{@check_number}, date:"\ " #{@date}, location: #{@location}, name: #{@name}, merchant_name: #{@merchant_name},"\ " original_description: #{@original_description}, payment_meta: #{@payment_meta}, pending:"\ " #{@pending}, pending_transaction_id: #{@pending_transaction_id}, account_owner:"\ " #{@account_owner}, transaction_id: #{@transaction_id}, transaction_type:"\ " #{@transaction_type}, logo_url: #{@logo_url}, website: #{@website}, authorized_date:"\ " #{@authorized_date}, authorized_datetime: #{@authorized_datetime}, datetime: #{@datetime},"\ " payment_channel: #{@payment_channel}, personal_finance_category:"\ " #{@personal_finance_category}, business_finance_category: #{@business_finance_category},"\ " transaction_code: #{@transaction_code}, personal_finance_category_icon_url:"\ " #{@personal_finance_category_icon_url}, counterparties: #{@counterparties},"\ " merchant_entity_id: #{@merchant_entity_id}, client_customization:"\ " #{@client_customization}, additional_properties: #{@additional_properties}>" end |