plaid 13.2.0 → 14.0.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (690) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +73 -9
  3. data/CONTRIBUTING.md +2 -32
  4. data/Dockerfile +11 -0
  5. data/Gemfile.lock +45 -40
  6. data/LICENSE.txt +1 -1
  7. data/PUBLISH.md +0 -1
  8. data/README.md +99 -93
  9. data/Rakefile +8 -79
  10. data/UPGRADING.md +4 -0
  11. data/docs/ACHClass.md +15 -0
  12. data/docs/APR.md +24 -0
  13. data/docs/AccountAssets.md +40 -0
  14. data/docs/AccountAssetsAllOf.md +24 -0
  15. data/docs/AccountBalance.md +26 -0
  16. data/docs/AccountBase.md +32 -0
  17. data/docs/AccountFiltersResponse.md +24 -0
  18. data/docs/AccountIdentity.md +34 -0
  19. data/docs/AccountIdentityAllOf.md +18 -0
  20. data/docs/AccountSubtype.md +15 -0
  21. data/docs/AccountType.md +15 -0
  22. data/docs/AccountsBalanceGetRequest.md +24 -0
  23. data/docs/AccountsBalanceGetRequestOptions.md +18 -0
  24. data/docs/AccountsGetRequest.md +24 -0
  25. data/docs/AccountsGetRequestOptions.md +18 -0
  26. data/docs/AccountsGetResponse.md +22 -0
  27. data/docs/Address.md +20 -0
  28. data/docs/AddressData.md +26 -0
  29. data/docs/Amount.md +20 -0
  30. data/docs/AssetReport.md +28 -0
  31. data/docs/AssetReportAuditCopyCreateRequest.md +24 -0
  32. data/docs/AssetReportAuditCopyCreateResponse.md +20 -0
  33. data/docs/AssetReportAuditCopyGetRequest.md +22 -0
  34. data/docs/AssetReportAuditCopyRemoveRequest.md +22 -0
  35. data/docs/AssetReportAuditCopyRemoveResponse.md +20 -0
  36. data/docs/AssetReportCreateRequest.md +26 -0
  37. data/docs/AssetReportCreateRequestOptions.md +22 -0
  38. data/docs/AssetReportCreateResponse.md +22 -0
  39. data/docs/AssetReportFilterRequest.md +24 -0
  40. data/docs/AssetReportFilterResponse.md +22 -0
  41. data/docs/AssetReportGetRequest.md +24 -0
  42. data/docs/AssetReportGetResponse.md +22 -0
  43. data/docs/AssetReportItem.md +26 -0
  44. data/docs/AssetReportPDFGetRequest.md +22 -0
  45. data/docs/AssetReportRefreshRequest.md +26 -0
  46. data/docs/AssetReportRefreshRequestOptions.md +22 -0
  47. data/docs/AssetReportRefreshResponse.md +22 -0
  48. data/docs/AssetReportRemoveRequest.md +22 -0
  49. data/docs/AssetReportRemoveResponse.md +20 -0
  50. data/docs/AssetReportTransaction.md +58 -0
  51. data/docs/AssetReportTransactionAllOf.md +20 -0
  52. data/docs/AssetReportUser.md +30 -0
  53. data/docs/AssetsErrorWebhook.md +24 -0
  54. data/docs/AssetsProductReadyWebhook.md +22 -0
  55. data/docs/AuthGetNumbers.md +24 -0
  56. data/docs/AuthGetRequest.md +24 -0
  57. data/docs/AuthGetRequestOptions.md +18 -0
  58. data/docs/AuthGetResponse.md +24 -0
  59. data/docs/AutomaticallyVerifiedWebhook.md +24 -0
  60. data/docs/BankTransfer.md +50 -0
  61. data/docs/BankTransferBalance.md +20 -0
  62. data/docs/BankTransferBalanceGetRequest.md +22 -0
  63. data/docs/BankTransferBalanceGetResponse.md +22 -0
  64. data/docs/BankTransferCancelRequest.md +22 -0
  65. data/docs/BankTransferCancelResponse.md +18 -0
  66. data/docs/BankTransferCreateRequest.md +46 -0
  67. data/docs/BankTransferCreateResponse.md +20 -0
  68. data/docs/BankTransferDirection.md +15 -0
  69. data/docs/BankTransferEvent.md +40 -0
  70. data/docs/BankTransferEventListRequest.md +40 -0
  71. data/docs/BankTransferEventListResponse.md +20 -0
  72. data/docs/BankTransferEventSyncRequest.md +24 -0
  73. data/docs/BankTransferEventSyncResponse.md +20 -0
  74. data/docs/BankTransferEventType.md +15 -0
  75. data/docs/BankTransferFailure.md +20 -0
  76. data/docs/BankTransferGetRequest.md +22 -0
  77. data/docs/BankTransferGetResponse.md +20 -0
  78. data/docs/BankTransferListRequest.md +32 -0
  79. data/docs/BankTransferListResponse.md +20 -0
  80. data/docs/BankTransferMigrateAccountRequest.md +26 -0
  81. data/docs/BankTransferMigrateAccountResponse.md +22 -0
  82. data/docs/BankTransferNetwork.md +15 -0
  83. data/docs/BankTransferReceiverDetails.md +18 -0
  84. data/docs/BankTransferStatus.md +15 -0
  85. data/docs/BankTransferType.md +15 -0
  86. data/docs/BankTransferUser.md +22 -0
  87. data/docs/CategoriesGetResponse.md +20 -0
  88. data/docs/Category.md +22 -0
  89. data/docs/Cause.md +20 -0
  90. data/docs/CountryCode.md +15 -0
  91. data/docs/CreditCardLiability.md +34 -0
  92. data/docs/CreditFilter.md +18 -0
  93. data/docs/DefaultUpdateWebhook.md +26 -0
  94. data/docs/DepositSwitchAddressData.md +26 -0
  95. data/docs/DepositSwitchAltCreateRequest.md +24 -0
  96. data/docs/DepositSwitchAltCreateResponse.md +20 -0
  97. data/docs/DepositSwitchCreateRequest.md +24 -0
  98. data/docs/DepositSwitchCreateResponse.md +20 -0
  99. data/docs/DepositSwitchGetRequest.md +22 -0
  100. data/docs/DepositSwitchGetResponse.md +38 -0
  101. data/docs/DepositSwitchTargetAccount.md +24 -0
  102. data/docs/DepositSwitchTargetUser.md +28 -0
  103. data/docs/DepositSwitchTokenCreateRequest.md +22 -0
  104. data/docs/DepositSwitchTokenCreateResponse.md +22 -0
  105. data/docs/DepositoryFilter.md +18 -0
  106. data/docs/Email.md +22 -0
  107. data/docs/Employee.md +22 -0
  108. data/docs/EmployeeIncomeSummaryFieldString.md +20 -0
  109. data/docs/Employer.md +24 -0
  110. data/docs/EmployerIncomeSummaryFieldString.md +20 -0
  111. data/docs/EmployersSearchRequest.md +24 -0
  112. data/docs/EmployersSearchResponse.md +20 -0
  113. data/docs/Error.md +34 -0
  114. data/docs/ExternalPaymentSchedule.md +24 -0
  115. data/docs/HealthIncident.md +24 -0
  116. data/docs/HistoricalBalance.md +24 -0
  117. data/docs/HistoricalUpdateWebhook.md +26 -0
  118. data/docs/Holding.md +34 -0
  119. data/docs/HoldingsDefaultUpdateWebhook.md +28 -0
  120. data/docs/IdentityGetRequest.md +24 -0
  121. data/docs/IdentityGetRequestOptions.md +18 -0
  122. data/docs/IdentityGetResponse.md +22 -0
  123. data/docs/IncidentUpdate.md +22 -0
  124. data/docs/IncomeBreakdown.md +24 -0
  125. data/docs/IncomeSummary.md +30 -0
  126. data/docs/IncomeSummaryFieldNumber.md +20 -0
  127. data/docs/IncomeSummaryFieldString.md +20 -0
  128. data/docs/IncomeVerificationCreateRequest.md +22 -0
  129. data/docs/IncomeVerificationCreateResponse.md +20 -0
  130. data/docs/IncomeVerificationDocumentsDownloadRequest.md +22 -0
  131. data/docs/IncomeVerificationDocumentsDownloadResponse.md +18 -0
  132. data/docs/IncomeVerificationPaystubGetRequest.md +22 -0
  133. data/docs/IncomeVerificationPaystubGetResponse.md +20 -0
  134. data/docs/IncomeVerificationStatusWebhook.md +24 -0
  135. data/docs/IncomeVerificationSummaryGetRequest.md +22 -0
  136. data/docs/IncomeVerificationSummaryGetResponse.md +20 -0
  137. data/docs/IncomeVerificationWebhookStatus.md +18 -0
  138. data/docs/InflowModel.md +26 -0
  139. data/docs/InitialUpdateWebhook.md +26 -0
  140. data/docs/Institution.md +36 -0
  141. data/docs/InstitutionStatus.md +30 -0
  142. data/docs/InstitutionsGetByIdRequest.md +26 -0
  143. data/docs/InstitutionsGetByIdRequestOptions.md +20 -0
  144. data/docs/InstitutionsGetByIdResponse.md +20 -0
  145. data/docs/InstitutionsGetRequest.md +28 -0
  146. data/docs/InstitutionsGetRequestOptions.md +24 -0
  147. data/docs/InstitutionsGetResponse.md +22 -0
  148. data/docs/InstitutionsSearchAccountFilter.md +24 -0
  149. data/docs/InstitutionsSearchRequest.md +28 -0
  150. data/docs/InstitutionsSearchRequestOptions.md +22 -0
  151. data/docs/InstitutionsSearchResponse.md +20 -0
  152. data/docs/InvestmentFilter.md +18 -0
  153. data/docs/InvestmentHoldingsGetRequestOptions.md +18 -0
  154. data/docs/InvestmentTransaction.md +44 -0
  155. data/docs/InvestmentsDefaultUpdateWebhook.md +28 -0
  156. data/docs/InvestmentsHoldingsGetRequest.md +24 -0
  157. data/docs/InvestmentsHoldingsGetResponse.md +26 -0
  158. data/docs/InvestmentsTransactionsGetRequest.md +28 -0
  159. data/docs/InvestmentsTransactionsGetRequestOptions.md +22 -0
  160. data/docs/InvestmentsTransactionsGetResponse.md +28 -0
  161. data/docs/Item.md +32 -0
  162. data/docs/ItemAccessTokenInvalidateRequest.md +22 -0
  163. data/docs/ItemAccessTokenInvalidateResponse.md +20 -0
  164. data/docs/ItemErrorWebhook.md +24 -0
  165. data/docs/ItemGetRequest.md +22 -0
  166. data/docs/ItemGetResponse.md +24 -0
  167. data/docs/ItemImportRequest.md +26 -0
  168. data/docs/ItemImportRequestOptions.md +18 -0
  169. data/docs/ItemImportRequestUserAuth.md +20 -0
  170. data/docs/ItemImportResponse.md +20 -0
  171. data/docs/ItemProductReadyWebhook.md +24 -0
  172. data/docs/ItemPublicTokenCreateRequest.md +22 -0
  173. data/docs/ItemPublicTokenCreateResponse.md +22 -0
  174. data/docs/ItemPublicTokenExchangeRequest.md +22 -0
  175. data/docs/ItemPublicTokenExchangeResponse.md +22 -0
  176. data/docs/ItemRemoveRequest.md +22 -0
  177. data/docs/ItemRemoveResponse.md +18 -0
  178. data/docs/ItemStatus.md +22 -0
  179. data/docs/ItemStatusInvestments.md +20 -0
  180. data/docs/ItemStatusLastWebhook.md +20 -0
  181. data/docs/ItemStatusTransactions.md +20 -0
  182. data/docs/ItemWebhookUpdateRequest.md +24 -0
  183. data/docs/ItemWebhookUpdateResponse.md +20 -0
  184. data/docs/JWKPublicKey.md +34 -0
  185. data/docs/JWTHeader.md +18 -0
  186. data/docs/LiabilitiesGetRequest.md +24 -0
  187. data/docs/LiabilitiesGetRequestOptions.md +18 -0
  188. data/docs/LiabilitiesGetResponse.md +24 -0
  189. data/docs/LiabilitiesObject.md +22 -0
  190. data/docs/LiabilityOverride.md +66 -0
  191. data/docs/LinkTokenAccountFilters.md +24 -0
  192. data/docs/LinkTokenCreateRequest.md +48 -0
  193. data/docs/LinkTokenCreateRequestAccountSubtypes.md +24 -0
  194. data/docs/LinkTokenCreateRequestAccountSubtypesCredit.md +18 -0
  195. data/docs/LinkTokenCreateRequestAccountSubtypesDepository.md +18 -0
  196. data/docs/LinkTokenCreateRequestAccountSubtypesInvestment.md +18 -0
  197. data/docs/LinkTokenCreateRequestAccountSubtypesLoan.md +18 -0
  198. data/docs/LinkTokenCreateRequestDepositSwitch.md +18 -0
  199. data/docs/LinkTokenCreateRequestIncomeVerification.md +20 -0
  200. data/docs/LinkTokenCreateRequestPaymentInitiation.md +18 -0
  201. data/docs/LinkTokenCreateRequestUser.md +32 -0
  202. data/docs/LinkTokenCreateResponse.md +22 -0
  203. data/docs/LinkTokenGetMetadataResponse.md +30 -0
  204. data/docs/LinkTokenGetRequest.md +22 -0
  205. data/docs/LinkTokenGetResponse.md +26 -0
  206. data/docs/LoanFilter.md +18 -0
  207. data/docs/Location.md +32 -0
  208. data/docs/MFA.md +26 -0
  209. data/docs/Meta.md +22 -0
  210. data/docs/MortgageInterestRate.md +20 -0
  211. data/docs/MortgageLiability.md +56 -0
  212. data/docs/MortgagePropertyAddress.md +26 -0
  213. data/docs/NullableAccessToken.md +15 -0
  214. data/docs/NullableAddress.md +20 -0
  215. data/docs/NullableAddressData.md +26 -0
  216. data/docs/NullableItemStatus.md +22 -0
  217. data/docs/NullableNumbersACH.md +24 -0
  218. data/docs/NullableNumbersBACS.md +22 -0
  219. data/docs/NullableNumbersEFT.md +24 -0
  220. data/docs/NullableNumbersInternational.md +22 -0
  221. data/docs/NullableRecipientBACS.md +20 -0
  222. data/docs/Numbers.md +32 -0
  223. data/docs/NumbersACH.md +24 -0
  224. data/docs/NumbersBACS.md +22 -0
  225. data/docs/NumbersEFT.md +24 -0
  226. data/docs/NumbersInternational.md +22 -0
  227. data/docs/OverrideAccounts.md +38 -0
  228. data/docs/Owner.md +24 -0
  229. data/docs/OwnerOverride.md +24 -0
  230. data/docs/PSLFStatus.md +22 -0
  231. data/docs/PayFrequency.md +20 -0
  232. data/docs/PayPeriodDetails.md +26 -0
  233. data/docs/PaymentAmount.md +20 -0
  234. data/docs/PaymentInitiationAddress.md +24 -0
  235. data/docs/PaymentInitiationPaymentCreateRequest.md +28 -0
  236. data/docs/PaymentInitiationPaymentCreateResponse.md +22 -0
  237. data/docs/PaymentInitiationPaymentGetRequest.md +22 -0
  238. data/docs/PaymentInitiationPaymentGetResponse.md +32 -0
  239. data/docs/PaymentInitiationPaymentListRequest.md +24 -0
  240. data/docs/PaymentInitiationPaymentListResponse.md +22 -0
  241. data/docs/PaymentInitiationPaymentTokenCreateRequest.md +22 -0
  242. data/docs/PaymentInitiationPaymentTokenCreateResponse.md +22 -0
  243. data/docs/PaymentInitiationRecipient.md +26 -0
  244. data/docs/PaymentInitiationRecipientBacs.md +20 -0
  245. data/docs/PaymentInitiationRecipientCreateRequest.md +28 -0
  246. data/docs/PaymentInitiationRecipientCreateResponse.md +20 -0
  247. data/docs/PaymentInitiationRecipientGetRequest.md +22 -0
  248. data/docs/PaymentInitiationRecipientGetResponse.md +28 -0
  249. data/docs/PaymentInitiationRecipientListRequest.md +20 -0
  250. data/docs/PaymentInitiationRecipientListResponse.md +20 -0
  251. data/docs/PaymentMeta.md +32 -0
  252. data/docs/PaymentStatusUpdateWebhook.md +30 -0
  253. data/docs/Paystub.md +30 -0
  254. data/docs/PaystubDeduction.md +22 -0
  255. data/docs/PaystubYTDDetails.md +20 -0
  256. data/docs/PendingExpirationWebhook.md +24 -0
  257. data/docs/PhoneNumber.md +22 -0
  258. data/docs/PlaidApi.md +5580 -0
  259. data/docs/ProcessorApexProcessorTokenCreateRequest.md +24 -0
  260. data/docs/ProcessorAuthGetRequest.md +22 -0
  261. data/docs/ProcessorAuthGetResponse.md +22 -0
  262. data/docs/ProcessorBalanceGetRequest.md +22 -0
  263. data/docs/ProcessorBalanceGetResponse.md +20 -0
  264. data/docs/ProcessorIdentityGetRequest.md +22 -0
  265. data/docs/ProcessorIdentityGetResponse.md +20 -0
  266. data/docs/ProcessorNumber.md +24 -0
  267. data/docs/ProcessorStripeBankAccountTokenCreateRequest.md +24 -0
  268. data/docs/ProcessorStripeBankAccountTokenCreateResponse.md +20 -0
  269. data/docs/ProcessorTokenCreateRequest.md +26 -0
  270. data/docs/ProcessorTokenCreateResponse.md +20 -0
  271. data/docs/ProductStatus.md +22 -0
  272. data/docs/ProductStatusBreakdown.md +24 -0
  273. data/docs/Products.md +15 -0
  274. data/docs/ProjectedIncomeSummaryFieldNumber.md +20 -0
  275. data/docs/RecaptchaRequiredError.md +30 -0
  276. data/docs/RecipientBACS.md +20 -0
  277. data/docs/SandboxBankTransferSimulateRequest.md +26 -0
  278. data/docs/SandboxBankTransferSimulateResponse.md +18 -0
  279. data/docs/SandboxItemFireWebhookRequest.md +24 -0
  280. data/docs/SandboxItemFireWebhookResponse.md +20 -0
  281. data/docs/SandboxItemResetLoginRequest.md +22 -0
  282. data/docs/SandboxItemResetLoginResponse.md +20 -0
  283. data/docs/SandboxItemSetVerificationStatusRequest.md +26 -0
  284. data/docs/SandboxItemSetVerificationStatusResponse.md +18 -0
  285. data/docs/SandboxProcessorTokenCreateRequest.md +24 -0
  286. data/docs/SandboxProcessorTokenCreateRequestOptions.md +20 -0
  287. data/docs/SandboxProcessorTokenCreateResponse.md +20 -0
  288. data/docs/SandboxPublicTokenCreateRequest.md +26 -0
  289. data/docs/SandboxPublicTokenCreateRequestOptions.md +24 -0
  290. data/docs/SandboxPublicTokenCreateRequestOptionsTransactions.md +20 -0
  291. data/docs/SandboxPublicTokenCreateResponse.md +20 -0
  292. data/docs/Security.md +46 -0
  293. data/docs/ServicerAddressData.md +26 -0
  294. data/docs/StandaloneAccountType.md +26 -0
  295. data/docs/StandaloneCurrencyCodeList.md +20 -0
  296. data/docs/StandaloneInvestmentTransactionSubtype.md +104 -0
  297. data/docs/StandaloneInvestmentTransactionType.md +28 -0
  298. data/docs/StudentLoan.md +66 -0
  299. data/docs/StudentLoanRepaymentModel.md +22 -0
  300. data/docs/StudentLoanStatus.md +20 -0
  301. data/docs/StudentRepaymentPlan.md +20 -0
  302. data/docs/Transaction.md +54 -0
  303. data/docs/TransactionCode.md +15 -0
  304. data/docs/TransactionData.md +26 -0
  305. data/docs/TransactionOverride.md +26 -0
  306. data/docs/TransactionsGetRequest.md +28 -0
  307. data/docs/TransactionsGetRequestOptions.md +22 -0
  308. data/docs/TransactionsGetResponse.md +26 -0
  309. data/docs/TransactionsRefreshRequest.md +22 -0
  310. data/docs/TransactionsRefreshResponse.md +18 -0
  311. data/docs/TransactionsRemovedWebhook.md +26 -0
  312. data/docs/UserCustomPassword.md +28 -0
  313. data/docs/UserPermissionRevokedWebhook.md +24 -0
  314. data/docs/VerificationExpiredWebhook.md +24 -0
  315. data/docs/VerificationStatus.md +15 -0
  316. data/docs/Warning.md +22 -0
  317. data/docs/WebhookUpdateAcknowledgedWebhook.md +26 -0
  318. data/docs/WebhookVerificationKeyGetRequest.md +22 -0
  319. data/docs/WebhookVerificationKeyGetResponse.md +20 -0
  320. data/docs/YTDGrossIncomeSummaryFieldNumber.md +20 -0
  321. data/docs/YTDNetIncomeSummaryFieldNumber.md +20 -0
  322. data/lib/plaid.rb +343 -61
  323. data/lib/plaid/api/plaid_api.rb +4414 -0
  324. data/lib/plaid/api_client.rb +383 -0
  325. data/lib/plaid/api_error.rb +57 -0
  326. data/lib/plaid/configuration.rb +297 -0
  327. data/lib/plaid/models/account_assets.rb +406 -0
  328. data/lib/plaid/models/account_assets_all_of.rb +263 -0
  329. data/lib/plaid/models/account_balance.rb +269 -0
  330. data/lib/plaid/models/account_base.rb +345 -0
  331. data/lib/plaid/models/account_filters_response.rb +246 -0
  332. data/lib/plaid/models/account_identity.rb +369 -0
  333. data/lib/plaid/models/account_identity_all_of.rb +226 -0
  334. data/lib/plaid/models/account_subtype.rb +101 -0
  335. data/lib/plaid/models/account_type.rb +41 -0
  336. data/lib/plaid/models/accounts_balance_get_request.rb +254 -0
  337. data/lib/plaid/models/accounts_balance_get_request_options.rb +222 -0
  338. data/lib/plaid/models/accounts_get_request.rb +254 -0
  339. data/lib/plaid/models/accounts_get_request_options.rb +222 -0
  340. data/lib/plaid/models/accounts_get_response.rb +256 -0
  341. data/lib/plaid/models/ach_class.rb +50 -0
  342. data/lib/plaid/models/address.rb +235 -0
  343. data/lib/plaid/models/address_data.rb +277 -0
  344. data/lib/plaid/models/amount.rb +274 -0
  345. data/lib/plaid/models/apr.rb +296 -0
  346. data/lib/plaid/models/asset_report.rb +301 -0
  347. data/lib/plaid/models/asset_report_audit_copy_create_request.rb +260 -0
  348. data/lib/plaid/models/asset_report_audit_copy_create_response.rb +240 -0
  349. data/lib/plaid/models/asset_report_audit_copy_get_request.rb +245 -0
  350. data/lib/plaid/models/asset_report_audit_copy_remove_request.rb +245 -0
  351. data/lib/plaid/models/asset_report_audit_copy_remove_response.rb +240 -0
  352. data/lib/plaid/models/asset_report_create_request.rb +299 -0
  353. data/lib/plaid/models/asset_report_create_request_options.rb +239 -0
  354. data/lib/plaid/models/asset_report_create_response.rb +255 -0
  355. data/lib/plaid/models/asset_report_filter_request.rb +262 -0
  356. data/lib/plaid/models/asset_report_filter_response.rb +255 -0
  357. data/lib/plaid/models/asset_report_get_request.rb +255 -0
  358. data/lib/plaid/models/asset_report_get_response.rb +256 -0
  359. data/lib/plaid/models/asset_report_item.rb +287 -0
  360. data/lib/plaid/models/asset_report_pdf_get_request.rb +245 -0
  361. data/lib/plaid/models/asset_report_refresh_request.rb +288 -0
  362. data/lib/plaid/models/asset_report_refresh_request_options.rb +239 -0
  363. data/lib/plaid/models/asset_report_refresh_response.rb +255 -0
  364. data/lib/plaid/models/asset_report_remove_request.rb +245 -0
  365. data/lib/plaid/models/asset_report_remove_response.rb +240 -0
  366. data/lib/plaid/models/asset_report_transaction.rb +511 -0
  367. data/lib/plaid/models/asset_report_transaction_all_of.rb +235 -0
  368. data/lib/plaid/models/asset_report_user.rb +287 -0
  369. data/lib/plaid/models/assets_error_webhook.rb +265 -0
  370. data/lib/plaid/models/assets_product_ready_webhook.rb +255 -0
  371. data/lib/plaid/models/auth_get_numbers.rb +258 -0
  372. data/lib/plaid/models/auth_get_request.rb +254 -0
  373. data/lib/plaid/models/auth_get_request_options.rb +222 -0
  374. data/lib/plaid/models/auth_get_response.rb +270 -0
  375. data/lib/plaid/models/automatically_verified_webhook.rb +270 -0
  376. data/lib/plaid/models/bank_transfer.rb +444 -0
  377. data/lib/plaid/models/bank_transfer_balance.rb +239 -0
  378. data/lib/plaid/models/bank_transfer_balance_get_request.rb +241 -0
  379. data/lib/plaid/models/bank_transfer_balance_get_response.rb +250 -0
  380. data/lib/plaid/models/bank_transfer_cancel_request.rb +245 -0
  381. data/lib/plaid/models/bank_transfer_cancel_response.rb +225 -0
  382. data/lib/plaid/models/bank_transfer_create_request.rb +459 -0
  383. data/lib/plaid/models/bank_transfer_create_response.rb +239 -0
  384. data/lib/plaid/models/bank_transfer_direction.rb +37 -0
  385. data/lib/plaid/models/bank_transfer_event.rb +388 -0
  386. data/lib/plaid/models/bank_transfer_event_list_request.rb +418 -0
  387. data/lib/plaid/models/bank_transfer_event_list_response.rb +241 -0
  388. data/lib/plaid/models/bank_transfer_event_sync_request.rb +301 -0
  389. data/lib/plaid/models/bank_transfer_event_sync_response.rb +241 -0
  390. data/lib/plaid/models/bank_transfer_event_type.rb +42 -0
  391. data/lib/plaid/models/bank_transfer_failure.rb +231 -0
  392. data/lib/plaid/models/bank_transfer_get_request.rb +245 -0
  393. data/lib/plaid/models/bank_transfer_get_response.rb +239 -0
  394. data/lib/plaid/models/bank_transfer_list_request.rb +336 -0
  395. data/lib/plaid/models/bank_transfer_list_response.rb +241 -0
  396. data/lib/plaid/models/bank_transfer_migrate_account_request.rb +275 -0
  397. data/lib/plaid/models/bank_transfer_migrate_account_response.rb +255 -0
  398. data/lib/plaid/models/bank_transfer_network.rb +38 -0
  399. data/lib/plaid/models/bank_transfer_receiver_details.rb +255 -0
  400. data/lib/plaid/models/bank_transfer_status.rb +40 -0
  401. data/lib/plaid/models/bank_transfer_type.rb +37 -0
  402. data/lib/plaid/models/bank_transfer_user.rb +246 -0
  403. data/lib/plaid/models/categories_get_response.rb +242 -0
  404. data/lib/plaid/models/category.rb +257 -0
  405. data/lib/plaid/models/cause.rb +235 -0
  406. data/lib/plaid/models/country_code.rb +42 -0
  407. data/lib/plaid/models/credit_card_liability.rb +339 -0
  408. data/lib/plaid/models/credit_filter.rb +227 -0
  409. data/lib/plaid/models/default_update_webhook.rb +280 -0
  410. data/lib/plaid/models/deposit_switch_address_data.rb +285 -0
  411. data/lib/plaid/models/deposit_switch_alt_create_request.rb +258 -0
  412. data/lib/plaid/models/deposit_switch_alt_create_response.rb +240 -0
  413. data/lib/plaid/models/deposit_switch_create_request.rb +260 -0
  414. data/lib/plaid/models/deposit_switch_create_response.rb +240 -0
  415. data/lib/plaid/models/deposit_switch_get_request.rb +245 -0
  416. data/lib/plaid/models/deposit_switch_get_response.rb +381 -0
  417. data/lib/plaid/models/deposit_switch_target_account.rb +303 -0
  418. data/lib/plaid/models/deposit_switch_target_user.rb +288 -0
  419. data/lib/plaid/models/deposit_switch_token_create_request.rb +245 -0
  420. data/lib/plaid/models/deposit_switch_token_create_response.rb +255 -0
  421. data/lib/plaid/models/depository_filter.rb +227 -0
  422. data/lib/plaid/models/email.rb +289 -0
  423. data/lib/plaid/models/employee.rb +242 -0
  424. data/lib/plaid/models/employee_income_summary_field_string.rb +245 -0
  425. data/lib/plaid/models/employer.rb +261 -0
  426. data/lib/plaid/models/employer_income_summary_field_string.rb +245 -0
  427. data/lib/plaid/models/employers_search_request.rb +262 -0
  428. data/lib/plaid/models/employers_search_response.rb +242 -0
  429. data/lib/plaid/models/error.rb +360 -0
  430. data/lib/plaid/models/external_payment_schedule.rb +265 -0
  431. data/lib/plaid/models/health_incident.rb +253 -0
  432. data/lib/plaid/models/historical_balance.rb +262 -0
  433. data/lib/plaid/models/historical_update_webhook.rb +280 -0
  434. data/lib/plaid/models/holding.rb +329 -0
  435. data/lib/plaid/models/holdings_default_update_webhook.rb +295 -0
  436. data/lib/plaid/models/identity_get_request.rb +254 -0
  437. data/lib/plaid/models/identity_get_request_options.rb +222 -0
  438. data/lib/plaid/models/identity_get_response.rb +256 -0
  439. data/lib/plaid/models/incident_update.rb +273 -0
  440. data/lib/plaid/models/income_breakdown.rb +253 -0
  441. data/lib/plaid/models/income_summary.rb +275 -0
  442. data/lib/plaid/models/income_summary_field_number.rb +238 -0
  443. data/lib/plaid/models/income_summary_field_string.rb +238 -0
  444. data/lib/plaid/models/income_verification_create_request.rb +245 -0
  445. data/lib/plaid/models/income_verification_create_response.rb +240 -0
  446. data/lib/plaid/models/income_verification_documents_download_request.rb +245 -0
  447. data/lib/plaid/models/income_verification_documents_download_response.rb +224 -0
  448. data/lib/plaid/models/income_verification_paystub_get_request.rb +245 -0
  449. data/lib/plaid/models/income_verification_paystub_get_response.rb +229 -0
  450. data/lib/plaid/models/income_verification_status_webhook.rb +270 -0
  451. data/lib/plaid/models/income_verification_summary_get_request.rb +245 -0
  452. data/lib/plaid/models/income_verification_summary_get_response.rb +242 -0
  453. data/lib/plaid/models/income_verification_webhook_status.rb +223 -0
  454. data/lib/plaid/models/inflow_model.rb +285 -0
  455. data/lib/plaid/models/initial_update_webhook.rb +281 -0
  456. data/lib/plaid/models/institution.rb +344 -0
  457. data/lib/plaid/models/institution_status.rb +307 -0
  458. data/lib/plaid/models/institutions_get_by_id_request.rb +271 -0
  459. data/lib/plaid/models/institutions_get_by_id_request_options.rb +234 -0
  460. data/lib/plaid/models/institutions_get_by_id_response.rb +239 -0
  461. data/lib/plaid/models/institutions_get_request.rb +305 -0
  462. data/lib/plaid/models/institutions_get_request_options.rb +254 -0
  463. data/lib/plaid/models/institutions_get_response.rb +257 -0
  464. data/lib/plaid/models/institutions_search_account_filter.rb +253 -0
  465. data/lib/plaid/models/institutions_search_request.rb +288 -0
  466. data/lib/plaid/models/institutions_search_request_options.rb +239 -0
  467. data/lib/plaid/models/institutions_search_response.rb +242 -0
  468. data/lib/plaid/models/investment_filter.rb +227 -0
  469. data/lib/plaid/models/investment_holdings_get_request_options.rb +222 -0
  470. data/lib/plaid/models/investment_transaction.rb +445 -0
  471. data/lib/plaid/models/investments_default_update_webhook.rb +295 -0
  472. data/lib/plaid/models/investments_holdings_get_request.rb +254 -0
  473. data/lib/plaid/models/investments_holdings_get_response.rb +290 -0
  474. data/lib/plaid/models/investments_transactions_get_request.rb +284 -0
  475. data/lib/plaid/models/investments_transactions_get_request_options.rb +285 -0
  476. data/lib/plaid/models/investments_transactions_get_response.rb +305 -0
  477. data/lib/plaid/models/item.rb +311 -0
  478. data/lib/plaid/models/item_access_token_invalidate_request.rb +245 -0
  479. data/lib/plaid/models/item_access_token_invalidate_response.rb +240 -0
  480. data/lib/plaid/models/item_error_webhook.rb +265 -0
  481. data/lib/plaid/models/item_get_request.rb +245 -0
  482. data/lib/plaid/models/item_get_response.rb +259 -0
  483. data/lib/plaid/models/item_import_request.rb +270 -0
  484. data/lib/plaid/models/item_import_request_options.rb +220 -0
  485. data/lib/plaid/models/item_import_request_user_auth.rb +240 -0
  486. data/lib/plaid/models/item_import_response.rb +240 -0
  487. data/lib/plaid/models/item_product_ready_webhook.rb +265 -0
  488. data/lib/plaid/models/item_public_token_create_request.rb +245 -0
  489. data/lib/plaid/models/item_public_token_create_response.rb +249 -0
  490. data/lib/plaid/models/item_public_token_exchange_request.rb +245 -0
  491. data/lib/plaid/models/item_public_token_exchange_response.rb +255 -0
  492. data/lib/plaid/models/item_remove_request.rb +245 -0
  493. data/lib/plaid/models/item_remove_response.rb +225 -0
  494. data/lib/plaid/models/item_status.rb +240 -0
  495. data/lib/plaid/models/item_status_investments.rb +232 -0
  496. data/lib/plaid/models/item_status_last_webhook.rb +232 -0
  497. data/lib/plaid/models/item_status_transactions.rb +232 -0
  498. data/lib/plaid/models/item_webhook_update_request.rb +260 -0
  499. data/lib/plaid/models/item_webhook_update_response.rb +239 -0
  500. data/lib/plaid/models/jwk_public_key.rb +299 -0
  501. data/lib/plaid/models/jwt_header.rb +224 -0
  502. data/lib/plaid/models/liabilities_get_request.rb +254 -0
  503. data/lib/plaid/models/liabilities_get_request_options.rb +222 -0
  504. data/lib/plaid/models/liabilities_get_response.rb +270 -0
  505. data/lib/plaid/models/liabilities_object.rb +249 -0
  506. data/lib/plaid/models/liability_override.rb +583 -0
  507. data/lib/plaid/models/link_token_account_filters.rb +246 -0
  508. data/lib/plaid/models/link_token_create_request.rb +390 -0
  509. data/lib/plaid/models/link_token_create_request_account_subtypes.rb +246 -0
  510. data/lib/plaid/models/link_token_create_request_account_subtypes_credit.rb +222 -0
  511. data/lib/plaid/models/link_token_create_request_account_subtypes_depository.rb +222 -0
  512. data/lib/plaid/models/link_token_create_request_account_subtypes_investment.rb +222 -0
  513. data/lib/plaid/models/link_token_create_request_account_subtypes_loan.rb +222 -0
  514. data/lib/plaid/models/link_token_create_request_deposit_switch.rb +225 -0
  515. data/lib/plaid/models/link_token_create_request_income_verification.rb +236 -0
  516. data/lib/plaid/models/link_token_create_request_payment_initiation.rb +225 -0
  517. data/lib/plaid/models/link_token_create_request_user.rb +295 -0
  518. data/lib/plaid/models/link_token_create_response.rb +255 -0
  519. data/lib/plaid/models/link_token_get_metadata_response.rb +287 -0
  520. data/lib/plaid/models/link_token_get_request.rb +245 -0
  521. data/lib/plaid/models/link_token_get_response.rb +266 -0
  522. data/lib/plaid/models/loan_filter.rb +227 -0
  523. data/lib/plaid/models/location.rb +298 -0
  524. data/lib/plaid/models/meta.rb +255 -0
  525. data/lib/plaid/models/mfa.rb +285 -0
  526. data/lib/plaid/models/mortgage_interest_rate.rb +232 -0
  527. data/lib/plaid/models/mortgage_liability.rb +430 -0
  528. data/lib/plaid/models/mortgage_property_address.rb +265 -0
  529. data/lib/plaid/models/nullable_access_token.rb +209 -0
  530. data/lib/plaid/models/nullable_address.rb +241 -0
  531. data/lib/plaid/models/nullable_address_data.rb +283 -0
  532. data/lib/plaid/models/nullable_item_status.rb +246 -0
  533. data/lib/plaid/models/nullable_numbers_ach.rb +272 -0
  534. data/lib/plaid/models/nullable_numbers_bacs.rb +261 -0
  535. data/lib/plaid/models/nullable_numbers_eft.rb +276 -0
  536. data/lib/plaid/models/nullable_numbers_international.rb +261 -0
  537. data/lib/plaid/models/nullable_recipient_bacs.rb +236 -0
  538. data/lib/plaid/models/numbers.rb +330 -0
  539. data/lib/plaid/models/numbers_ach.rb +266 -0
  540. data/lib/plaid/models/numbers_bacs.rb +255 -0
  541. data/lib/plaid/models/numbers_eft.rb +270 -0
  542. data/lib/plaid/models/numbers_international.rb +255 -0
  543. data/lib/plaid/models/override_accounts.rb +366 -0
  544. data/lib/plaid/models/owner.rb +278 -0
  545. data/lib/plaid/models/owner_override.rb +278 -0
  546. data/lib/plaid/models/pay_frequency.rb +272 -0
  547. data/lib/plaid/models/pay_period_details.rb +265 -0
  548. data/lib/plaid/models/payment_amount.rb +240 -0
  549. data/lib/plaid/models/payment_initiation_address.rb +252 -0
  550. data/lib/plaid/models/payment_initiation_payment_create_request.rb +284 -0
  551. data/lib/plaid/models/payment_initiation_payment_create_response.rb +255 -0
  552. data/lib/plaid/models/payment_initiation_payment_get_request.rb +245 -0
  553. data/lib/plaid/models/payment_initiation_payment_get_response.rb +353 -0
  554. data/lib/plaid/models/payment_initiation_payment_list_request.rb +267 -0
  555. data/lib/plaid/models/payment_initiation_payment_list_response.rb +257 -0
  556. data/lib/plaid/models/payment_initiation_payment_token_create_request.rb +245 -0
  557. data/lib/plaid/models/payment_initiation_payment_token_create_response.rb +255 -0
  558. data/lib/plaid/models/payment_initiation_recipient.rb +271 -0
  559. data/lib/plaid/models/payment_initiation_recipient_bacs.rb +237 -0
  560. data/lib/plaid/models/payment_initiation_recipient_create_request.rb +275 -0
  561. data/lib/plaid/models/payment_initiation_recipient_create_response.rb +240 -0
  562. data/lib/plaid/models/payment_initiation_recipient_get_request.rb +245 -0
  563. data/lib/plaid/models/payment_initiation_recipient_get_response.rb +286 -0
  564. data/lib/plaid/models/payment_initiation_recipient_list_request.rb +230 -0
  565. data/lib/plaid/models/payment_initiation_recipient_list_response.rb +242 -0
  566. data/lib/plaid/models/payment_meta.rb +298 -0
  567. data/lib/plaid/models/payment_status_update_webhook.rb +356 -0
  568. data/lib/plaid/models/paystub.rb +306 -0
  569. data/lib/plaid/models/paystub_deduction.rb +242 -0
  570. data/lib/plaid/models/paystub_ytd_details.rb +239 -0
  571. data/lib/plaid/models/pending_expiration_webhook.rb +270 -0
  572. data/lib/plaid/models/phone_number.rb +281 -0
  573. data/lib/plaid/models/processor_apex_processor_token_create_request.rb +260 -0
  574. data/lib/plaid/models/processor_auth_get_request.rb +245 -0
  575. data/lib/plaid/models/processor_auth_get_response.rb +253 -0
  576. data/lib/plaid/models/processor_balance_get_request.rb +245 -0
  577. data/lib/plaid/models/processor_balance_get_response.rb +239 -0
  578. data/lib/plaid/models/processor_identity_get_request.rb +245 -0
  579. data/lib/plaid/models/processor_identity_get_response.rb +239 -0
  580. data/lib/plaid/models/processor_number.rb +250 -0
  581. data/lib/plaid/models/processor_stripe_bank_account_token_create_request.rb +260 -0
  582. data/lib/plaid/models/processor_stripe_bank_account_token_create_response.rb +240 -0
  583. data/lib/plaid/models/processor_token_create_request.rb +275 -0
  584. data/lib/plaid/models/processor_token_create_response.rb +240 -0
  585. data/lib/plaid/models/product_status.rb +288 -0
  586. data/lib/plaid/models/product_status_breakdown.rb +300 -0
  587. data/lib/plaid/models/products.rb +45 -0
  588. data/lib/plaid/models/projected_income_summary_field_number.rb +245 -0
  589. data/lib/plaid/models/pslf_status.rb +243 -0
  590. data/lib/plaid/models/recaptcha_required_error.rb +314 -0
  591. data/lib/plaid/models/recipient_bacs.rb +230 -0
  592. data/lib/plaid/models/sandbox_bank_transfer_simulate_request.rb +270 -0
  593. data/lib/plaid/models/sandbox_bank_transfer_simulate_response.rb +225 -0
  594. data/lib/plaid/models/sandbox_item_fire_webhook_request.rb +289 -0
  595. data/lib/plaid/models/sandbox_item_fire_webhook_response.rb +240 -0
  596. data/lib/plaid/models/sandbox_item_reset_login_request.rb +245 -0
  597. data/lib/plaid/models/sandbox_item_reset_login_response.rb +240 -0
  598. data/lib/plaid/models/sandbox_item_set_verification_status_request.rb +309 -0
  599. data/lib/plaid/models/sandbox_item_set_verification_status_response.rb +225 -0
  600. data/lib/plaid/models/sandbox_processor_token_create_request.rb +253 -0
  601. data/lib/plaid/models/sandbox_processor_token_create_request_options.rb +236 -0
  602. data/lib/plaid/models/sandbox_processor_token_create_response.rb +239 -0
  603. data/lib/plaid/models/sandbox_public_token_create_request.rb +271 -0
  604. data/lib/plaid/models/sandbox_public_token_create_request_options.rb +255 -0
  605. data/lib/plaid/models/sandbox_public_token_create_request_options_transactions.rb +230 -0
  606. data/lib/plaid/models/sandbox_public_token_create_response.rb +240 -0
  607. data/lib/plaid/models/security.rb +382 -0
  608. data/lib/plaid/models/servicer_address_data.rb +265 -0
  609. data/lib/plaid/models/standalone_account_type.rb +285 -0
  610. data/lib/plaid/models/standalone_currency_code_list.rb +240 -0
  611. data/lib/plaid/models/standalone_investment_transaction_subtype.rb +650 -0
  612. data/lib/plaid/models/standalone_investment_transaction_type.rb +300 -0
  613. data/lib/plaid/models/student_loan.rb +483 -0
  614. data/lib/plaid/models/student_loan_repayment_model.rb +255 -0
  615. data/lib/plaid/models/student_loan_status.rb +266 -0
  616. data/lib/plaid/models/student_repayment_plan.rb +266 -0
  617. data/lib/plaid/models/transaction.rb +478 -0
  618. data/lib/plaid/models/transaction_code.rb +48 -0
  619. data/lib/plaid/models/transaction_data.rb +285 -0
  620. data/lib/plaid/models/transaction_override.rb +280 -0
  621. data/lib/plaid/models/transactions_get_request.rb +284 -0
  622. data/lib/plaid/models/transactions_get_request_options.rb +285 -0
  623. data/lib/plaid/models/transactions_get_response.rb +288 -0
  624. data/lib/plaid/models/transactions_refresh_request.rb +240 -0
  625. data/lib/plaid/models/transactions_refresh_response.rb +225 -0
  626. data/lib/plaid/models/transactions_removed_webhook.rb +282 -0
  627. data/lib/plaid/models/user_custom_password.rb +297 -0
  628. data/lib/plaid/models/user_permission_revoked_webhook.rb +265 -0
  629. data/lib/plaid/models/verification_expired_webhook.rb +270 -0
  630. data/lib/plaid/models/verification_status.rb +40 -0
  631. data/lib/plaid/models/warning.rb +254 -0
  632. data/lib/plaid/models/webhook_update_acknowledged_webhook.rb +280 -0
  633. data/lib/plaid/models/webhook_verification_key_get_request.rb +245 -0
  634. data/lib/plaid/models/webhook_verification_key_get_response.rb +239 -0
  635. data/lib/plaid/models/ytd_gross_income_summary_field_number.rb +245 -0
  636. data/lib/plaid/models/ytd_net_income_summary_field_number.rb +245 -0
  637. data/lib/plaid/version.rb +13 -2
  638. data/plaid.gemspec +44 -49
  639. data/templates/ruby/api_client.mustache +266 -0
  640. data/templates/ruby/api_client_faraday_partial.mustache +120 -0
  641. data/templates/ruby/configuration.mustache +353 -0
  642. data/templates/ruby/gemspec.mustache +41 -0
  643. data/test/test_accounts.rb +103 -0
  644. data/test/test_asset_report.rb +147 -0
  645. data/test/test_auth.rb +61 -0
  646. data/test/test_bank_transfers.rb +219 -0
  647. data/test/test_categories.rb +10 -0
  648. data/test/test_configuration.rb +26 -0
  649. data/test/test_deposit_switch.rb +73 -0
  650. data/test/test_helper.rb +109 -0
  651. data/test/test_identity.rb +38 -0
  652. data/test/test_institutions.rb +159 -0
  653. data/test/test_investments.rb +205 -0
  654. data/test/test_item.rb +285 -0
  655. data/test/test_liabilities.rb +45 -0
  656. data/test/test_link_token.rb +97 -0
  657. data/test/test_payment_initiation.rb +95 -0
  658. data/test/test_processor.rb +67 -0
  659. data/test/test_transactions.rb +165 -0
  660. data/test/test_webhooks.rb +22 -0
  661. metadata +687 -99
  662. data/.circleci/config.yml +0 -21
  663. data/.env.sample +0 -3
  664. data/.github/workflows/add_to_project.yml +0 -21
  665. data/.rubocop.yml +0 -18
  666. data/bin/console +0 -14
  667. data/bin/setup +0 -8
  668. data/lib/plaid/client.rb +0 -190
  669. data/lib/plaid/errors.rb +0 -89
  670. data/lib/plaid/middleware.rb +0 -31
  671. data/lib/plaid/models.rb +0 -2221
  672. data/lib/plaid/products/accounts.rb +0 -63
  673. data/lib/plaid/products/asset_report.rb +0 -199
  674. data/lib/plaid/products/auth.rb +0 -42
  675. data/lib/plaid/products/base_product.rb +0 -64
  676. data/lib/plaid/products/categories.rb +0 -21
  677. data/lib/plaid/products/credit_details.rb +0 -40
  678. data/lib/plaid/products/deposit_switch.rb +0 -99
  679. data/lib/plaid/products/identity.rb +0 -31
  680. data/lib/plaid/products/income.rb +0 -31
  681. data/lib/plaid/products/institutions.rb +0 -91
  682. data/lib/plaid/products/investments.rb +0 -127
  683. data/lib/plaid/products/item.rb +0 -209
  684. data/lib/plaid/products/liabilities.rb +0 -39
  685. data/lib/plaid/products/link_token.rb +0 -74
  686. data/lib/plaid/products/payment_initiation.rb +0 -251
  687. data/lib/plaid/products/processor.rb +0 -190
  688. data/lib/plaid/products/sandbox.rb +0 -148
  689. data/lib/plaid/products/transactions.rb +0 -81
  690. data/lib/plaid/products/webhooks.rb +0 -23
data/test/test_item.rb ADDED
@@ -0,0 +1,285 @@
1
+ require_relative "test_helper"
2
+
3
+ # Internal: The test for Plaid::Item.
4
+ class PlaidItemTest < PlaidTest # rubocop:disable Metrics/ClassLength
5
+ def test_create
6
+ create_item
7
+ refute_empty(@item.item.to_hash)
8
+
9
+ assert_equal(["transactions"], @item.item.billed_products)
10
+ assert_equal(SANDBOX_INSTITUTION, @item.item.institution_id)
11
+ end
12
+
13
+ def test_create_invalid_institution
14
+ begin
15
+ create_item institution_id: BAD_STRING
16
+ rescue Plaid::ApiError => e
17
+ json_response = JSON.parse(e.response_body)
18
+ assert_equal(json_response["error_code"], "INVALID_INSTITUTION")
19
+ end
20
+ end
21
+
22
+ def test_create_invalid_initial_products
23
+ begin
24
+ create_item initial_products: BAD_ARRAY
25
+ rescue Plaid::ApiError => e
26
+ json_response = JSON.parse(e.response_body)
27
+ assert_equal(json_response["error_code"], "INVALID_PRODUCT")
28
+ end
29
+ end
30
+
31
+ def test_create_bad_initial_products
32
+ begin
33
+ create_item initial_products: BAD_STRING
34
+ rescue Plaid::ApiError => e
35
+ json_response = JSON.parse(e.response_body)
36
+ assert_equal(json_response["error_code"], "INVALID_FIELD")
37
+ end
38
+ end
39
+
40
+ def test_create_with_options
41
+ create_item(transactions_start_date: "2016-01-01",
42
+ transactions_end_date: "2016-02-01",
43
+ webhook: "https://plaid.com/webhook-test")
44
+
45
+ refute_empty(item.item.to_hash)
46
+ assert_equal("https://plaid.com/webhook-test", item.item.webhook)
47
+ end
48
+
49
+ def test_create_with_additional_options
50
+ options = { transactions: { start_date: "2016-01-01",
51
+ end_date: "2016-02-01" },
52
+ webhook: "https://plaid.com/webhook-test" }
53
+
54
+ create_item(options: options)
55
+
56
+ refute_empty(item.item.to_hash)
57
+ assert_equal("https://plaid.com/webhook-test", item.item.webhook)
58
+ end
59
+
60
+ def test_create_with_options_date_objects
61
+ create_item(transactions_start_date: Date.parse("2016-01-01"),
62
+ transactions_end_date: Date.parse("2017-01-01"),
63
+ webhook: "https://plaid.com/webhook-test")
64
+
65
+ refute_empty(item.item.to_hash)
66
+ assert_equal("https://plaid.com/webhook-test", item.item.webhook)
67
+ end
68
+
69
+ def test_create_with_invalid_options
70
+ assert_raises(Plaid::ApiError) do
71
+ create_item(transactions_start_date: BAD_STRING,
72
+ transactions_end_date: BAD_STRING,
73
+ webhook: BAD_STRING)
74
+ end
75
+ end
76
+
77
+ def test_get
78
+ create_item
79
+
80
+ item_get_request = Plaid::ItemGetRequest.new
81
+ item_get_request.access_token = access_token
82
+
83
+ item = client.item_get(item_get_request)
84
+ refute_empty(item.item.to_hash)
85
+ refute_empty(item.status.to_hash)
86
+ assert_kind_of(Plaid::ItemGetResponse, item)
87
+ end
88
+
89
+ def test_get_valid_access_token
90
+ item_get_request = Plaid::ItemGetRequest.new
91
+ item_get_request.access_token = BAD_STRING
92
+
93
+ begin
94
+ item = client.item_get(item_get_request)
95
+ rescue Plaid::ApiError => e
96
+ json_response = JSON.parse(e.response_body)
97
+ assert_equal(json_response["error_code"], "INVALID_ACCESS_TOKEN")
98
+ end
99
+ end
100
+
101
+ def test_remove
102
+ create_item
103
+
104
+ item_remove_request = Plaid::ItemRemoveRequest.new
105
+ item_remove_request.access_token = access_token
106
+
107
+ remove_response = client.item_remove(item_remove_request)
108
+ refute_empty(remove_response.to_hash)
109
+ assert_kind_of(Plaid::ItemRemoveResponse, remove_response)
110
+
111
+ # Don't remove it in teardown again
112
+ @access_token = nil
113
+ end
114
+
115
+ def test_remove_invalid_access_token
116
+ item_remove_request = Plaid::ItemRemoveRequest.new
117
+ item_remove_request.access_token = BAD_STRING
118
+
119
+ begin
120
+ remove_response = client.item_remove(item_remove_request)
121
+ rescue Plaid::ApiError => e
122
+ json_response = JSON.parse(e.response_body)
123
+ assert_equal(json_response["error_code"], "INVALID_ACCESS_TOKEN")
124
+ end
125
+ end
126
+
127
+ def test_public_token_exchange_token
128
+ create_item
129
+
130
+ sandbox_public_token_create_request = Plaid::SandboxPublicTokenCreateRequest.new
131
+ sandbox_public_token_create_request.institution_id = SANDBOX_INSTITUTION
132
+ sandbox_public_token_create_request.initial_products = ["transactions"]
133
+
134
+ public_token_response = client.sandbox_public_token_create(
135
+ sandbox_public_token_create_request
136
+ )
137
+
138
+ refute_empty(public_token_response.public_token)
139
+
140
+ item_public_token_exchange_request = Plaid::ItemPublicTokenExchangeRequest.new
141
+ item_public_token_exchange_request.public_token = public_token_response.public_token
142
+
143
+ exchange_token_response = client.item_public_token_exchange(
144
+ item_public_token_exchange_request
145
+ )
146
+ refute_empty(exchange_token_response.access_token)
147
+ end
148
+
149
+ def test_exchange_token_invalid_public_token
150
+ item_public_token_exchange_request = Plaid::ItemPublicTokenExchangeRequest.new
151
+ item_public_token_exchange_request.public_token = BAD_STRING
152
+
153
+ begin
154
+ client.item_public_token_exchange(item_public_token_exchange_request)
155
+ rescue Plaid::ApiError => e
156
+ json_response = JSON.parse(e.response_body)
157
+ assert_equal(json_response["error_code"], "INVALID_PUBLIC_TOKEN")
158
+ end
159
+ end
160
+
161
+ def test_public_token_sandbox
162
+ sandbox_public_token_create_request = Plaid::SandboxPublicTokenCreateRequest.new
163
+ sandbox_public_token_create_request.institution_id = SANDBOX_INSTITUTION
164
+ sandbox_public_token_create_request.initial_products = ["transactions"]
165
+
166
+ public_token_response = client.sandbox_public_token_create(
167
+ sandbox_public_token_create_request
168
+ )
169
+ refute_empty(public_token_response.public_token)
170
+ end
171
+
172
+ def test_fire_webhook_sandbox
173
+ sandbox_public_token_create_request = Plaid::SandboxPublicTokenCreateRequest.new
174
+ sandbox_public_token_create_request.institution_id = SANDBOX_INSTITUTION
175
+ sandbox_public_token_create_request.initial_products = ["transactions"]
176
+ sandbox_public_token_create_request.options = {
177
+ webhook: "https://httpstat.us/200"
178
+ }
179
+
180
+ public_token_response = client.sandbox_public_token_create(
181
+ sandbox_public_token_create_request
182
+ )
183
+
184
+ refute_empty(public_token_response.public_token)
185
+
186
+ item_public_token_exchange_request = Plaid::ItemPublicTokenExchangeRequest.new
187
+ item_public_token_exchange_request.public_token = public_token_response.public_token
188
+
189
+ exchange_token_response = client.item_public_token_exchange(
190
+ item_public_token_exchange_request
191
+ )
192
+
193
+ sandbox_item_fire_webhook_request = Plaid::SandboxItemFireWebhookRequest.new
194
+
195
+ sandbox_item_fire_webhook_request.access_token = exchange_token_response.access_token
196
+ sandbox_item_fire_webhook_request.webhook_code = "DEFAULT_UPDATE"
197
+
198
+ fire_webhook_response = client.sandbox_item_fire_webhook(
199
+ sandbox_item_fire_webhook_request
200
+ )
201
+ assert_equal true, fire_webhook_response.webhook_fired
202
+ end
203
+
204
+ def test_access_token_invalidate
205
+ create_item
206
+
207
+ item_access_token_invalidate_request = Plaid::ItemAccessTokenInvalidateRequest.new
208
+ item_access_token_invalidate_request.access_token = access_token
209
+
210
+ invalidate_response = client.item_access_token_invalidate(item_access_token_invalidate_request)
211
+ refute_empty(invalidate_response.new_access_token)
212
+
213
+ @access_token = invalidate_response.new_access_token
214
+ end
215
+
216
+ def test_access_token_invalidate_invalid_access_token
217
+ item_access_token_invalidate_request = Plaid::ItemAccessTokenInvalidateRequest.new
218
+ item_access_token_invalidate_request.access_token = BAD_STRING
219
+
220
+ begin
221
+ client.item_access_token_invalidate(item_access_token_invalidate_request)
222
+ rescue Plaid::ApiError => e
223
+ json_response = JSON.parse(e.response_body)
224
+ assert_equal(json_response["error_code"], "INVALID_ACCESS_TOKEN")
225
+ end
226
+ end
227
+
228
+ def test_webhook_update
229
+ create_item
230
+
231
+ item_webhook_update_request = Plaid::ItemWebhookUpdateRequest.new
232
+ item_webhook_update_request.access_token = access_token
233
+ item_webhook_update_request.webhook = "https://plaid.com/webhook-test"
234
+
235
+ webhook_response = client.item_webhook_update(
236
+ item_webhook_update_request
237
+ )
238
+
239
+ assert_equal "https://plaid.com/webhook-test",
240
+ webhook_response.item.webhook
241
+ end
242
+
243
+ def test_webhook_update_invalid_access_token
244
+ item_webhook_update_request = Plaid::ItemWebhookUpdateRequest.new
245
+ item_webhook_update_request.access_token = BAD_STRING
246
+ item_webhook_update_request.webhook = "https://plaid.com/webhook-test"
247
+
248
+ begin
249
+ client.item_webhook_update(item_webhook_update_request)
250
+ rescue Plaid::ApiError => e
251
+ json_response = JSON.parse(e.response_body)
252
+ assert_equal(json_response["error_code"], "INVALID_ACCESS_TOKEN")
253
+ end
254
+ end
255
+
256
+ def test_webhook_update_invalid_webhook
257
+ create_item
258
+
259
+ item_webhook_update_request = Plaid::ItemWebhookUpdateRequest.new
260
+ item_webhook_update_request.access_token = access_token
261
+ item_webhook_update_request.webhook = BAD_STRING
262
+
263
+ begin
264
+ client.item_webhook_update(item_webhook_update_request)
265
+ rescue Plaid::ApiError => e
266
+ json_response = JSON.parse(e.response_body)
267
+ assert_equal(json_response["error_code"], "INVALID_FIELD")
268
+ end
269
+ end
270
+
271
+ def test_import_item
272
+ item_import_request = Plaid::ItemImportRequest.new
273
+
274
+ item_import_request.products = %w[identity auth]
275
+ item_import_request.user_auth = {
276
+ user_id: "user_good",
277
+ auth_token: "pass_good",
278
+ }
279
+
280
+ import_response = client.item_import(
281
+ item_import_request
282
+ )
283
+ refute_empty(import_response.access_token)
284
+ end
285
+ end
@@ -0,0 +1,45 @@
1
+ require_relative "test_helper"
2
+
3
+ # Internal: The test for Plaid::Liabilities.
4
+ class PlaidLiabilitiesTest < PlaidTest
5
+ def test_get
6
+ create_item initial_products: [:liabilities], institution_id: "ins_1"
7
+
8
+ liabilities_get_request = Plaid::LiabilitiesGetRequest.new
9
+ liabilities_get_request.access_token = access_token
10
+
11
+ response = client.liabilities_get(liabilities_get_request)
12
+
13
+ refute_empty(response.accounts)
14
+ refute_empty(response.liabilities.to_hash)
15
+ refute_empty(response.liabilities.student)
16
+ refute_empty(response.liabilities.credit)
17
+ assert_kind_of(Plaid::LiabilitiesGetResponse, response)
18
+
19
+ account_id = response.accounts[7].account_id
20
+
21
+ options_payload = {}
22
+ options_payload[:account_ids] = [account_id]
23
+
24
+ liabilities_get_request = Plaid::LiabilitiesGetRequest.new
25
+ liabilities_get_request.access_token = access_token
26
+ liabilities_get_request.options = options_payload
27
+
28
+ response = client.liabilities_get(
29
+ liabilities_get_request
30
+ )
31
+ assert_equal(1, response.liabilities.student.size)
32
+ end
33
+
34
+ def test_get_invalid_access_token
35
+ liabilities_get_request = Plaid::LiabilitiesGetRequest.new
36
+ liabilities_get_request.access_token = BAD_STRING
37
+
38
+ begin
39
+ client.liabilities_get(liabilities_get_request)
40
+ rescue Plaid::ApiError => e
41
+ json_response = JSON.parse(e.response_body)
42
+ assert_equal(json_response["error_code"], "INVALID_ACCESS_TOKEN")
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,97 @@
1
+ require_relative "test_helper"
2
+
3
+ # Internal: The test for Plaid::Item.
4
+ class PlaidLinkTokenTest < PlaidTest
5
+ def test_create_required
6
+ link_token_create_request = Plaid::LinkTokenCreateRequest.new({
7
+ :user => { :client_user_id => "123-fake-user-id" },
8
+ :client_name => "Plaid Test",
9
+ :products => %w[auth transactions],
10
+ :country_codes => ["GB"],
11
+ :language => "en",
12
+ })
13
+
14
+ link_token_response = client.link_token_create(
15
+ link_token_create_request
16
+ )
17
+
18
+ refute_empty(link_token_response.link_token)
19
+ refute_nil(link_token_response.expiration)
20
+ assert_kind_of(Plaid::LinkTokenCreateResponse, link_token_response)
21
+ end
22
+
23
+ # rubocop:disable Metrics/MethodLength
24
+ def test_create_optional
25
+ link_token_create_request = Plaid::LinkTokenCreateRequest.new({
26
+ :user => {
27
+ :client_user_id => "123-fake-user-id",
28
+ :legal_name => "John Doe",
29
+ :phone_number => "+1 415 555 0123",
30
+ :phone_number_verified_time => "2020-01-01T00:00:00Z",
31
+ :email_address => "example@plaid.com",
32
+ :email_address_verified_time => "2020-01-01T00:00:00Z",
33
+ },
34
+ :client_name => "Plaid Test",
35
+ :products => %w[auth transactions],
36
+ :country_codes => ["GB"],
37
+ :language => "en",
38
+ :webhook => "https://sample-webhook.com",
39
+ :link_customization_name => "default",
40
+ :account_filters => {
41
+ :depository => {
42
+ :account_subtypes => %w[checking savings],
43
+ },
44
+ },
45
+ })
46
+
47
+ link_token_response = client.link_token_create(
48
+ link_token_create_request
49
+ )
50
+
51
+ refute_empty(link_token_response.link_token)
52
+ refute_nil(link_token_response.expiration)
53
+ assert_kind_of(Plaid::LinkTokenCreateResponse, link_token_response)
54
+ end
55
+
56
+ def test_create_and_get
57
+ link_token_create_request = Plaid::LinkTokenCreateRequest.new({
58
+ :user => { :client_user_id => "123-fake-user-id" },
59
+ :client_name => "Plaid Test",
60
+ :products => %w[auth transactions],
61
+ :country_codes => ["GB"],
62
+ :language => "en",
63
+ :webhook => "https://sample-webhook.com",
64
+ :link_customization_name => "default",
65
+ :account_filters => {
66
+ :depository => {
67
+ :account_subtypes => %w[checking savings],
68
+ },
69
+ },
70
+ })
71
+ create_link_token_response = client.link_token_create(
72
+ link_token_create_request
73
+ )
74
+
75
+ refute_empty(create_link_token_response.link_token)
76
+ refute_nil(create_link_token_response.expiration)
77
+
78
+ link_token_get_request = Plaid::LinkTokenGetRequest.new({
79
+ :link_token => create_link_token_response.link_token,
80
+ })
81
+
82
+ get_link_token_response = client.link_token_get(link_token_get_request)
83
+ refute_empty(get_link_token_response.link_token)
84
+ refute_nil(get_link_token_response.expiration)
85
+
86
+ assert_equal("Plaid Test", get_link_token_response.metadata.client_name)
87
+ assert_equal(%w[auth transactions], get_link_token_response.metadata.initial_products)
88
+ assert_equal("en", get_link_token_response.metadata.language)
89
+ assert_equal("https://sample-webhook.com", get_link_token_response.metadata.webhook)
90
+
91
+ get_link_token_response_hash = get_link_token_response.to_hash
92
+ assert_equal([:account_subtypes], get_link_token_response_hash[:metadata][:account_filters][:depository].keys)
93
+ assert_equal(%w[checking savings], get_link_token_response_hash[:metadata][:account_filters][:depository][:account_subtypes])
94
+ end
95
+
96
+ # rubocop:enable Metrics/MethodLength
97
+ end
@@ -0,0 +1,95 @@
1
+ require_relative "test_helper"
2
+
3
+ # Internal: The test for Plaid::PaymentInitiation.
4
+ class PlaidPaymentInitiationTest < PlaidTest
5
+ # rubocop:disable Metrics/MethodLength
6
+ def test_all_routes
7
+ # create recipient
8
+ payment_initiation_recipient_create_request = Plaid::PaymentInitiationRecipientCreateRequest.new
9
+ payment_initiation_recipient_create_request.name = "John Doe"
10
+ payment_initiation_recipient_create_request.iban = "GB33BUKB20201555555555"
11
+ payment_initiation_recipient_create_request.address = {
12
+ street: ["Street Name 999"],
13
+ city: "City",
14
+ postal_code: "99999",
15
+ country: "GB",
16
+ }
17
+ payment_initiation_recipient_create_request.bacs = {
18
+ account: "26207729",
19
+ sort_code: "560029",
20
+ }
21
+
22
+ create_recipient_response = client.payment_initiation_recipient_create(
23
+ payment_initiation_recipient_create_request
24
+ )
25
+ recipient_id = create_recipient_response.recipient_id
26
+ refute_empty(recipient_id)
27
+
28
+ # get recipient
29
+ payment_initiation_recipient_get_request = Plaid::PaymentInitiationRecipientGetRequest.new
30
+ payment_initiation_recipient_get_request.recipient_id = recipient_id
31
+
32
+ get_recipient_response = client.payment_initiation_recipient_get(
33
+ payment_initiation_recipient_get_request
34
+ )
35
+
36
+ refute_empty(get_recipient_response.recipient_id)
37
+ refute_empty(get_recipient_response.name)
38
+ refute_empty(get_recipient_response.iban)
39
+ refute_empty(get_recipient_response.bacs.to_hash)
40
+ assert_kind_of(Plaid::NullableRecipientBACS, get_recipient_response.bacs)
41
+ refute_empty(get_recipient_response.address.to_hash)
42
+ assert_kind_of(Plaid::PaymentInitiationAddress, get_recipient_response.address)
43
+ assert_kind_of(Plaid::PaymentInitiationRecipientGetResponse, get_recipient_response)
44
+
45
+ # list recipients
46
+ payment_initiation_recipient_list_request = Plaid::PaymentInitiationRecipientListRequest.new
47
+
48
+ list_recipients_response = client.payment_initiation_payment_list(payment_initiation_recipient_list_request)
49
+ refute_empty(list_recipients_response.payments)
50
+
51
+ # create payment
52
+ payment_initiation_payment_create_request = Plaid::PaymentInitiationPaymentCreateRequest.new
53
+ payment_initiation_payment_create_request.recipient_id = recipient_id
54
+ payment_initiation_payment_create_request.reference = "testpayment"
55
+ payment_initiation_payment_create_request.amount = {
56
+ value: 100.00,
57
+ currency: "GBP",
58
+ }
59
+
60
+ create_payment_response = client.payment_initiation_payment_create(
61
+ payment_initiation_payment_create_request
62
+ )
63
+
64
+ payment_id = create_payment_response.payment_id
65
+ refute_empty(payment_id)
66
+ assert_kind_of(Plaid::PaymentInitiationPaymentCreateResponse, create_payment_response)
67
+
68
+ # get payment
69
+ payment_initiation_payment_get_request = Plaid::PaymentInitiationPaymentGetRequest.new
70
+ payment_initiation_payment_get_request.payment_id = payment_id
71
+
72
+ get_payment_response = client.payment_initiation_payment_get(payment_initiation_payment_get_request)
73
+
74
+ refute_empty(get_payment_response.payment_id)
75
+ refute_empty(get_payment_response.reference)
76
+ refute_empty(get_payment_response.amount.to_hash)
77
+ assert_kind_of(Plaid::PaymentAmount, get_payment_response.amount)
78
+ refute_empty(get_payment_response.status)
79
+ refute_empty(get_payment_response.last_status_update)
80
+ refute_empty(get_payment_response.recipient_id)
81
+ assert_kind_of(Plaid::PaymentInitiationPaymentGetResponse, get_payment_response)
82
+
83
+ # list payments
84
+ payment_initiation_payment_list_request = Plaid::PaymentInitiationPaymentListRequest.new
85
+ payment_initiation_payment_list_request.count = 10
86
+
87
+ list_payments_response = client.payment_initiation_payment_list(
88
+ payment_initiation_payment_list_request
89
+ )
90
+ refute_empty(list_payments_response.payments)
91
+ assert_kind_of(Plaid::PaymentInitiationPaymentListResponse, list_payments_response)
92
+ end
93
+
94
+ # rubocop:enable Metrics/MethodLength
95
+ end