From 82f1a1ed46f7ec3583cb2ac396241f09947b6277 Mon Sep 17 00:00:00 2001 From: Stuart Turner Date: Tue, 19 Sep 2023 17:41:43 -0500 Subject: [PATCH] Update to Plaid v1.431.7 --- plaid-openapi | 2 +- src/Plaid.OpenApiParser/Program.cs | 5 +- src/Plaid/AssetReport/PlaidClient.cs | 3 +- .../Converters/WebhookBaseConverter.Map.cs | 7 +- src/Plaid/Entity/AccountAssets.cs | 6 ++ src/Plaid/Entity/AddressMatchScore.cs | 2 +- src/Plaid/Entity/AssetReportInvestments.cs | 86 +++++++++++++++++++ src/Plaid/Entity/BankIncomeCompleteResult.cs | 6 +- .../Entity/ConsumerReportUserIdentity.cs | 2 +- src/Plaid/Entity/Counterparty.cs | 19 +++- .../Entity/CraBankIncomeCompleteResult.cs | 25 ++++++ ...tFreddieMacReportingInformation_VOA_2_4.cs | 6 ++ src/Plaid/Entity/CreditPayStubEmployee.cs | 2 +- src/Plaid/Entity/Enhancements.cs | 4 +- src/Plaid/Entity/Enrichments.cs | 6 +- src/Plaid/Entity/LinkEventName.cs | 6 ++ .../Entity/LinkTokenCreateRequestAuth.cs | 2 +- ...eateRequestAuthRerouteToCredentialsEnum.cs | 2 +- src/Plaid/Entity/OmittableTransferType.cs | 25 ++++++ src/Plaid/Entity/PersonalFinanceCategory.cs | 4 +- ...rocessorTokenCreateRequestProcessorEnum.cs | 6 ++ src/Plaid/Entity/SignalWarning.cs | 2 +- src/Plaid/Entity/SimulatedTransferSweep.cs | 12 +++ src/Plaid/Entity/StatementsAccount.cs | 2 +- src/Plaid/Entity/StatementsStatement.cs | 2 +- .../Entity/StudentRepaymentPlanTypeEnum.cs | 6 ++ src/Plaid/Entity/SweepTrigger.cs | 37 ++++++++ src/Plaid/Entity/Transaction.cs | 12 ++- .../Entity/TransactionsGetRequestOptions.cs | 2 +- .../Entity/TransactionsSyncRequestOptions.cs | 2 +- src/Plaid/Entity/TransferACHNetwork.cs | 25 ++++++ .../TransferAuthorizationDecisionRationale.cs | 2 +- ...nsferAuthorizationDecisionRationaleCode.cs | 18 ++-- .../Entity/TransferAuthorizationDevice.cs | 6 +- .../TransferAuthorizationUserInRequest.cs | 10 +-- src/Plaid/Entity/TransferEvent.cs | 16 ++-- src/Plaid/Entity/TransferEventType.cs | 32 ++++++- src/Plaid/Entity/TransferFundingAccount.cs | 19 ++++ .../TransferLedgerSweepSimulateEventType.cs | 43 ++++++++++ .../Entity/TransferOriginatorDiligence.cs | 6 ++ src/Plaid/Entity/TransferRecurringSchedule.cs | 6 +- src/Plaid/Entity/TransferSweep.cs | 12 +++ .../Entity/TransferUserAddressInRequest.cs | 2 +- src/Plaid/Entity/TransferUserInRequest.cs | 2 +- .../Entity/TransferUserInRequestDeprecated.cs | 2 +- src/Plaid/Entity/WebhookCode.cs | 12 +-- src/Plaid/Entity/WebhookType.cs | 16 ++-- src/Plaid/Link/LinkTokenCreateRequest.cs | 19 ++-- src/Plaid/Processor/PlaidClient.cs | 11 ++- .../Processor/ProcessorAccountGetRequest.cs | 13 +++ .../Processor/ProcessorAccountGetResponse.cs | 13 +++ src/Plaid/Sandbox/PlaidClient.cs | 33 ++++++- ...boxTransferLedgerDepositSimulateRequest.cs | 31 +++++++ ...oxTransferLedgerDepositSimulateResponse.cs | 8 ++ ...xTransferLedgerSimulateAvailableRequest.cs | 13 +++ ...TransferLedgerSimulateAvailableResponse.cs | 8 ++ ...oxTransferLedgerWithdrawSimulateRequest.cs | 31 +++++++ ...xTransferLedgerWithdrawSimulateResponse.cs | 8 ++ src/Plaid/Signal/PlaidClient.cs | 3 +- src/Plaid/Statements/PlaidClient.cs | 6 +- src/Plaid/Transfer/PlaidClient.cs | 30 ++++++- .../TransferAuthorizationCreateRequest.cs | 15 ++-- .../TransferCapabilitiesGetRequest.cs | 2 +- src/Plaid/Transfer/TransferCreateRequest.cs | 8 +- .../Transfer/TransferIntentCreateRequest.cs | 2 +- .../Transfer/TransferLedgerDepositRequest.cs | 44 ++++++++++ .../Transfer/TransferLedgerDepositResponse.cs | 16 ++++ .../Transfer/TransferLedgerWithdrawRequest.cs | 44 ++++++++++ .../TransferLedgerWithdrawResponse.cs | 16 ++++ ...erOriginatorFundingAccountUpdateRequest.cs | 19 ++++ ...rOriginatorFundingAccountUpdateResponse.cs | 8 ++ .../TransferRecurringCreateRequest.cs | 4 +- .../Transfer/TransferSweepListRequest.cs | 6 ++ src/Plaid/User/PlaidClient.cs | 9 ++ src/Plaid/User/UserUpdateRequest.cs | 19 ++++ src/Plaid/User/UserUpdateResponse.cs | 8 ++ .../Webhook/BankIncomeCompleteWebhook.cs | 6 +- src/Plaid/Webhook/BaseReportsErrorWebhook.cs | 6 +- .../Webhook/BaseReportsProductReadyWebhook.cs | 2 +- .../Webhook/CraBankIncomeCompleteWebhook.cs | 27 ++++++ .../IncomeVerificationStatusWebhook.cs | 4 +- src/Plaid/Webhook/ItemLoginRepairedWebhook.cs | 2 +- .../RecurringTransferSkippedWebhook.cs | 2 +- .../WalletTransactionStatusUpdateWebhook.cs | 2 +- 84 files changed, 900 insertions(+), 130 deletions(-) create mode 100644 src/Plaid/Entity/AssetReportInvestments.cs create mode 100644 src/Plaid/Entity/CraBankIncomeCompleteResult.cs create mode 100644 src/Plaid/Entity/OmittableTransferType.cs create mode 100644 src/Plaid/Entity/SweepTrigger.cs create mode 100644 src/Plaid/Entity/TransferACHNetwork.cs create mode 100644 src/Plaid/Entity/TransferFundingAccount.cs create mode 100644 src/Plaid/Entity/TransferLedgerSweepSimulateEventType.cs create mode 100644 src/Plaid/Processor/ProcessorAccountGetRequest.cs create mode 100644 src/Plaid/Processor/ProcessorAccountGetResponse.cs create mode 100644 src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateRequest.cs create mode 100644 src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateResponse.cs create mode 100644 src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableRequest.cs create mode 100644 src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableResponse.cs create mode 100644 src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateRequest.cs create mode 100644 src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateResponse.cs create mode 100644 src/Plaid/Transfer/TransferLedgerDepositRequest.cs create mode 100644 src/Plaid/Transfer/TransferLedgerDepositResponse.cs create mode 100644 src/Plaid/Transfer/TransferLedgerWithdrawRequest.cs create mode 100644 src/Plaid/Transfer/TransferLedgerWithdrawResponse.cs create mode 100644 src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateRequest.cs create mode 100644 src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateResponse.cs create mode 100644 src/Plaid/User/UserUpdateRequest.cs create mode 100644 src/Plaid/User/UserUpdateResponse.cs create mode 100644 src/Plaid/Webhook/CraBankIncomeCompleteWebhook.cs diff --git a/plaid-openapi b/plaid-openapi index ca7f4919..3bf995bb 160000 --- a/plaid-openapi +++ b/plaid-openapi @@ -1 +1 @@ -Subproject commit ca7f491936715a7652aa1ce277eb632eef27c9e8 +Subproject commit 3bf995bb3fa91a77b6499a183e7075ee86887a5e diff --git a/src/Plaid.OpenApiParser/Program.cs b/src/Plaid.OpenApiParser/Program.cs index 4e7c0bce..f6c2c65f 100644 --- a/src/Plaid.OpenApiParser/Program.cs +++ b/src/Plaid.OpenApiParser/Program.cs @@ -153,7 +153,7 @@ private static void AddSchemaEntity(string basePath, string name, BaseType baseT var (pd, ed) = ParseEnumDescription(schema.Description); static string GetEnumName(string name) => - $"{(char.IsDigit(name[0]) ? "_" : "")}{name.ToLower().ToPascalCase()}"; + $"{(char.IsDigit(name[0]) ? "_" : "")}{name.Replace(".", "_").ToLower().ToPascalCase()}"; schemaEntities[name] = new() { @@ -250,6 +250,9 @@ private static (string enumDescription, Dictionary propertyDescr { if (string.IsNullOrWhiteSpace(description)) return (string.Empty, new Dictionary()); + if (description.StartsWith("The asynchronous event to be simulated.", StringComparison.OrdinalIgnoreCase)) + return (FixupDescription(description), new Dictionary()); + var lines = description.Split(newLineSplits, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries); if (lines.Length == 1) diff --git a/src/Plaid/AssetReport/PlaidClient.cs b/src/Plaid/AssetReport/PlaidClient.cs index 2e01a647..326af965 100644 --- a/src/Plaid/AssetReport/PlaidClient.cs +++ b/src/Plaid/AssetReport/PlaidClient.cs @@ -15,8 +15,7 @@ public sealed partial class PlaidClient /// /// The /asset_report/get endpoint retrieves the Asset Report in JSON format. Before calling /asset_report/get, you must first create the Asset Report using /asset_report/create (or filter an Asset Report using /asset_report/filter) and then wait for the PRODUCT_READY webhook to fire, indicating that the Report is ready to be retrieved. /// By default, an Asset Report includes transaction descriptions as returned by the bank, as opposed to parsed and categorized by Plaid. You can also receive cleaned and categorized transactions, as well as additional insights like merchant name or location information. We call this an Asset Report with Insights. An Asset Report with Insights provides transaction category, location, and merchant information in addition to the transaction strings provided in a standard Asset Report. To retrieve an Asset Report with Insights, call /asset_report/get endpoint with include_insights set to true. - /// If report_type was set to VERIFICATION_OF_EMPLOYMENT when the Asset Report was created in /asset_report/create, debit transactions and transaction amounts won’t be included in the report. - /// For latency-sensitive applications, you can optionally call /asset_report/create with options.add_ons set to ["fast_assets"]. This will cause Plaid to create two versions of the Asset Report: one with only current and available balance and identity information, and then later on the complete Asset Report. You will receive separate webhooks for each version of the Asset Report. + /// For latency-sensitive applications, you can optionally call /asset_report/create with options.add_ons set to ["fast_assets"]. This will cause Plaid to create two versions of the Asset Report: one with only current and available balance and identity information, and then later on the complete Asset Report. You will receive separate webhooks for each version of the Asset Report. /// /// public Task AssetReportGetAsync(AssetReport.AssetReportGetRequest request) => diff --git a/src/Plaid/Converters/WebhookBaseConverter.Map.cs b/src/Plaid/Converters/WebhookBaseConverter.Map.cs index c9f6243b..6b4f972a 100644 --- a/src/Plaid/Converters/WebhookBaseConverter.Map.cs +++ b/src/Plaid/Converters/WebhookBaseConverter.Map.cs @@ -48,14 +48,15 @@ public partial class WebhookBaseConverter : JsonConverter [(WebhookType.Item, WebhookCode.NewAccountsAvailable)] = typeof(NewAccountsAvailableWebhook), [(WebhookType.LinkDelivery, WebhookCode.DeliveryStatus)] = typeof(LinkUserDeliveryStatusWebhook), [(WebhookType.LinkDelivery, WebhookCode.LinkCallback)] = typeof(LinkDeliveryCallbackWebhook), + [(WebhookType.BaseReport, WebhookCode.ProductReady)] = typeof(BaseReportsProductReadyWebhook), + [(WebhookType.BaseReport, WebhookCode.Error)] = typeof(BaseReportsErrorWebhook), + [(WebhookType.CraIncome, WebhookCode.BankIncomeComplete)] = typeof(CraBankIncomeCompleteWebhook), + [(WebhookType.Income, WebhookCode.BankIncomeComplete)] = typeof(BankIncomeCompleteWebhook), [(WebhookType.Income, WebhookCode.BankIncomeRefreshUpdate)] = typeof(BankIncomeRefreshUpdateWebhook), [(WebhookType.Income, WebhookCode.BankIncomeRefreshComplete)] = typeof(BankIncomeRefreshCompleteWebhook), [(WebhookType.Link, WebhookCode.Events)] = typeof(LinkEventsWebhook), [(WebhookType.Link, WebhookCode.SessionFinished)] = typeof(LinkSessionFinishedWebhook), [(WebhookType.Assets, WebhookCode.ProductReady)] = typeof(AssetsProductReadyWebhook), [(WebhookType.Assets, WebhookCode.Error)] = typeof(AssetsErrorWebhook), - [(WebhookType.BaseReport, WebhookCode.ProductReady)] = typeof(BaseReportsProductReadyWebhook), - [(WebhookType.BaseReport, WebhookCode.Error)] = typeof(BaseReportsErrorWebhook), - [(WebhookType.CraIncome, WebhookCode.BankIncomeComplete)] = typeof(BankIncomeCompleteWebhook), }; } \ No newline at end of file diff --git a/src/Plaid/Entity/AccountAssets.cs b/src/Plaid/Entity/AccountAssets.cs index 3e03e41f..eec167ad 100644 --- a/src/Plaid/Entity/AccountAssets.cs +++ b/src/Plaid/Entity/AccountAssets.cs @@ -74,6 +74,12 @@ public record AccountAssets [JsonPropertyName("transactions")] public IReadOnlyList Transactions { get; init; } = default!; + /// + /// A transaction within an investment account. + /// + [JsonPropertyName("investments")] + public Entity.AssetReportInvestments? Investments { get; init; } = default!; + /// /// Data returned by the financial institution about the account owner or owners.For business accounts, the name reported may be either the name of the individual or the name of the business, depending on the institution. Multiple owners on a single account will be represented in the same owner object, not in multiple owner objects within the array. In API versions 2018-05-22 and earlier, the owners object is not returned, and instead identity information is returned in the top level identity object. For more details, see Plaid API versioning /// diff --git a/src/Plaid/Entity/AddressMatchScore.cs b/src/Plaid/Entity/AddressMatchScore.cs index 12242522..9fa3d05c 100644 --- a/src/Plaid/Entity/AddressMatchScore.cs +++ b/src/Plaid/Entity/AddressMatchScore.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public record AddressMatchScore { /// - /// Match score for address. 100 is a perfect match, 99-90 is a strong match, 89-80 is a partial match, anything below 80 is considered a weak match. Typically, the match threshold should be set to a score of 80 or higher. If the address is missing from either the API or financial institution, this is null. + /// Match score for address. 100 is a perfect match, 99-90 is a strong match, 89-70 is a partial match, anything below 70 is considered a weak match. Typically, the match threshold should be set to a score of 70 or higher. If the address is missing from either the API or financial institution, this is null. /// [JsonPropertyName("score")] public int? Score { get; init; } = default!; diff --git a/src/Plaid/Entity/AssetReportInvestments.cs b/src/Plaid/Entity/AssetReportInvestments.cs new file mode 100644 index 00000000..87c93a76 --- /dev/null +++ b/src/Plaid/Entity/AssetReportInvestments.cs @@ -0,0 +1,86 @@ +namespace Going.Plaid.Entity; + +/// +/// A transaction within an investment account. +/// +public record AssetReportInvestments +{ + /// + /// The ID of the Investment transaction, unique across all Plaid transactions. Like all Plaid identifiers, the investment_transaction_id is case sensitive. + /// + [JsonPropertyName("investment_transaction_id")] + public string InvestmentTransactionId { get; init; } = default!; + + /// + /// The account_id of the account against which this transaction posted. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; init; } = default!; + + /// + /// The security_id to which this transaction is related. + /// + [JsonPropertyName("security_id")] + public string? SecurityId { get; init; } = default!; + + /// + /// The ISO 8601 posting date for the transaction. + /// + [JsonPropertyName("date")] + public DateOnly Date { get; init; } = default!; + + /// + /// The institution’s description of the transaction. + /// + [JsonPropertyName("name")] + public string Name { get; init; } = default!; + + /// + /// The number of units of the security involved in this transaction. Positive for buy transactions; negative for sell transactions. + /// + [JsonPropertyName("quantity")] + public decimal Quantity { get; init; } = default!; + + /// + /// The complete value of the transaction. Positive values when cash is debited, e.g. purchases of stock; negative values when cash is credited, e.g. sales of stock. Treatment remains the same for cash-only movements unassociated with securities. + /// + [JsonPropertyName("amount")] + public decimal Amount { get; init; } = default!; + + /// + /// The price of the security at which this transaction occurred. + /// + [JsonPropertyName("price")] + public decimal Price { get; init; } = default!; + + /// + /// The combined value of all fees applied to this transaction + /// + [JsonPropertyName("fees")] + public decimal? Fees { get; init; } = default!; + + /// + /// Value is one of the following: + /// + [JsonPropertyName("type")] + public Entity.InvestmentTransactionType Type { get; init; } = default!; + + /// + /// For descriptions of possible transaction types and subtypes, see the [Investment transaction types schema](https://plaid.com/docs/api/accounts/#investment-transaction-types-schema). + /// + [JsonPropertyName("subtype")] + public Entity.InvestmentTransactionSubtype Subtype { get; init; } = default!; + + /// + /// The ISO-4217 currency code of the transaction. Always null if unofficial_currency_code is non-null. + /// + [JsonPropertyName("iso_currency_code")] + public string? IsoCurrencyCode { get; init; } = default!; + + /// + /// The unofficial currency code associated with the holding. 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 for a full listing of supported iso_currency_codes. + /// + [JsonPropertyName("unofficial_currency_code")] + public string? UnofficialCurrencyCode { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Entity/BankIncomeCompleteResult.cs b/src/Plaid/Entity/BankIncomeCompleteResult.cs index 8ee03597..beb60b97 100644 --- a/src/Plaid/Entity/BankIncomeCompleteResult.cs +++ b/src/Plaid/Entity/BankIncomeCompleteResult.cs @@ -1,18 +1,18 @@ namespace Going.Plaid.Entity; /// -/// The result of the bank income refresh report generation +/// The result of the bank income report generation /// public enum BankIncomeCompleteResult { /// - /// The refreshed report was successfully generated and can be retrieved via /cra/bank_income/get. + /// The bank income report was successfully generated and can be retrieved via /credit/bank_income/get. /// [EnumMember(Value = "SUCCESS")] Success, /// - /// The refreshed report failed to be generated + /// The bank income report failed to be generated /// [EnumMember(Value = "FAILURE")] Failure, diff --git a/src/Plaid/Entity/ConsumerReportUserIdentity.cs b/src/Plaid/Entity/ConsumerReportUserIdentity.cs index a3ea1d08..5aa3a1b1 100644 --- a/src/Plaid/Entity/ConsumerReportUserIdentity.cs +++ b/src/Plaid/Entity/ConsumerReportUserIdentity.cs @@ -18,7 +18,7 @@ public class ConsumerReportUserIdentity public string LastName { get; set; } = default!; /// - /// The user's phone numbers + /// The user's phone numbers. The format of phone number will be validated and for better normalization, it is expected to be in E.164 format +{countrycode}{number}, for example +14151234567. /// [JsonPropertyName("phone_numbers")] public IReadOnlyList PhoneNumbers { get; set; } = default!; diff --git a/src/Plaid/Entity/Counterparty.cs b/src/Plaid/Entity/Counterparty.cs index 89d61134..8b0d3a31 100644 --- a/src/Plaid/Entity/Counterparty.cs +++ b/src/Plaid/Entity/Counterparty.cs @@ -11,6 +11,12 @@ public record Counterparty [JsonPropertyName("name")] public string Name { get; init; } = default!; + /// + /// A unique, stable, Plaid-generated ID that maps to the counterparty. + /// + [JsonPropertyName("entity_id")] + public string? EntityId { get; init; } = default!; + /// /// The counterparty type. /// @@ -24,8 +30,19 @@ public record Counterparty public string? Website { get; init; } = default!; /// - /// The URL of a logo associated with the counterparty, if available. The logo is formatted as a 100x100 pixel PNG filepath. + /// The URL of a logo associated with the counterparty, if available. The logo will always be 100×100 pixel PNG file. /// [JsonPropertyName("logo_url")] public string? LogoUrl { get; init; } = default!; + + /// + /// A description of how confident we are that the provided counterparty is involved in the transaction. + /// VERY_HIGH: We recognize this counterparty and we are more than 98% confident that it is involved in this transaction. + /// HIGH: We recognize this counterparty and we are more than 90% confident that it is involved in this transaction. + /// MEDIUM: We are moderately confident that this counterparty was involved in this transaction, but some details may differ from our records. + /// LOW: We didn’t find a matching counterparty in our records, so we are returning a cleansed name parsed out of the request description. + /// UNKNOWN: We don’t know the confidence level for this counterparty. + /// + [JsonPropertyName("confidence_level")] + public string? ConfidenceLevel { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/CraBankIncomeCompleteResult.cs b/src/Plaid/Entity/CraBankIncomeCompleteResult.cs new file mode 100644 index 00000000..ff169a19 --- /dev/null +++ b/src/Plaid/Entity/CraBankIncomeCompleteResult.cs @@ -0,0 +1,25 @@ +namespace Going.Plaid.Entity; + +/// +/// The result of the bank income report generation +/// +public enum CraBankIncomeCompleteResult +{ + /// + /// The bank income report was successfully generated and can be retrieved via /cra/bank_income/get. + /// + [EnumMember(Value = "SUCCESS")] + Success, + + /// + /// The bank income report failed to be generated + /// + [EnumMember(Value = "FAILURE")] + Failure, + + /// + /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. + /// + [EnumMember(Value = "undefined")] + Undefined, +} \ No newline at end of file diff --git a/src/Plaid/Entity/CreditFreddieMacReportingInformation_VOA_2_4.cs b/src/Plaid/Entity/CreditFreddieMacReportingInformation_VOA_2_4.cs index f5c19472..20a25623 100644 --- a/src/Plaid/Entity/CreditFreddieMacReportingInformation_VOA_2_4.cs +++ b/src/Plaid/Entity/CreditFreddieMacReportingInformation_VOA_2_4.cs @@ -17,6 +17,12 @@ public record CreditFreddieMacReportingInformation_VOA_2_4 [JsonPropertyName("ReportIdentifierType")] public string? Reportidentifiertype { get; init; } = default!; + /// + /// Documentation not found in the MISMO model viewer and not provided by Freddie Mac. + /// + [JsonPropertyName("ReportingInformationParentIdentifier")] + public string? Reportinginformationparentidentifier { get; init; } = default!; + /// /// Documentation not found in the MISMO model viewer and not provided by Freddie Mac. /// diff --git a/src/Plaid/Entity/CreditPayStubEmployee.cs b/src/Plaid/Entity/CreditPayStubEmployee.cs index 3457d192..4ca5b804 100644 --- a/src/Plaid/Entity/CreditPayStubEmployee.cs +++ b/src/Plaid/Entity/CreditPayStubEmployee.cs @@ -18,7 +18,7 @@ public record CreditPayStubEmployee public string? Name { get; init; } = default!; /// - /// Marital status of the employee - either SINGLE or MARRIED. + /// Marital status of the employee - either SINGLE or MARRIED or NOT LISTED. /// [JsonPropertyName("marital_status")] public string? MaritalStatus { get; init; } = default!; diff --git a/src/Plaid/Entity/Enhancements.cs b/src/Plaid/Entity/Enhancements.cs index 6e95e546..05cc0b1b 100644 --- a/src/Plaid/Entity/Enhancements.cs +++ b/src/Plaid/Entity/Enhancements.cs @@ -18,7 +18,7 @@ public record Enhancements public string? Website { get; init; } = default!; /// - /// The URL of a logo associated with this transaction, if available. The logo is formatted as a 100x100 pixel PNG file. + /// The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file. /// [JsonPropertyName("logo_url")] public string? LogoUrl { get; init; } = default!; @@ -61,7 +61,7 @@ public record Enhancements public Entity.PersonalFinanceCategory? PersonalFinanceCategory { get; init; } = default!; /// - /// A link to the icon associated with the primary personal finance category. The logo will always be 100x100 pixels. + /// The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. /// [JsonPropertyName("personal_finance_category_icon_url")] public string? PersonalFinanceCategoryIconUrl { get; init; } = default!; diff --git a/src/Plaid/Entity/Enrichments.cs b/src/Plaid/Entity/Enrichments.cs index 1a06c4f8..74ea9b71 100644 --- a/src/Plaid/Entity/Enrichments.cs +++ b/src/Plaid/Entity/Enrichments.cs @@ -18,7 +18,7 @@ public record Enrichments public IReadOnlyList Counterparties { get; init; } = default!; /// - /// A unique, stable, Plaid-generated id that maps to the primary counterparty. + /// A unique, stable, Plaid-generated ID that maps to the primary counterparty. /// [JsonPropertyName("entity_id")] public string? EntityId { get; init; } = default!; @@ -44,7 +44,7 @@ public record Enrichments public Entity.Location Location { get; init; } = default!; /// - /// The URL of a logo associated with this transaction, if available. The logo is formatted as a 100x100 pixel PNG file. + /// The URL of a logo associated with this transaction, if available. The logo will always be 100×100 pixel PNG file. /// [JsonPropertyName("logo_url")] public string? LogoUrl { get; init; } = default!; @@ -69,7 +69,7 @@ public record Enrichments public Entity.PersonalFinanceCategory? PersonalFinanceCategory { get; init; } = default!; /// - /// A link to the icon associated with the primary personal finance category. The logo will always be 100x100 pixels. + /// The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. /// [JsonPropertyName("personal_finance_category_icon_url")] public string PersonalFinanceCategoryIconUrl { get; init; } = default!; diff --git a/src/Plaid/Entity/LinkEventName.cs b/src/Plaid/Entity/LinkEventName.cs index e44c5c30..a5550329 100644 --- a/src/Plaid/Entity/LinkEventName.cs +++ b/src/Plaid/Entity/LinkEventName.cs @@ -89,6 +89,12 @@ public enum LinkEventName [EnumMember(Value = "SELECT_DOWN_INSTITUTION")] SelectDownInstitution, + /// + /// + /// + [EnumMember(Value = "SELECT_FILTERED_INSTITUTION")] + SelectFilteredInstitution, + /// /// /// diff --git a/src/Plaid/Entity/LinkTokenCreateRequestAuth.cs b/src/Plaid/Entity/LinkTokenCreateRequestAuth.cs index a225c4dd..9f245156 100644 --- a/src/Plaid/Entity/LinkTokenCreateRequestAuth.cs +++ b/src/Plaid/Entity/LinkTokenCreateRequestAuth.cs @@ -30,7 +30,7 @@ public class LinkTokenCreateRequestAuth public bool? SameDayMicrodepositsEnabled { get; set; } = default!; /// - /// Specifies what type of Reroute to Credentials pane should be used in the Link session for the Same Day Micro-deposits flow. + /// Specifies what type of [Reroute to Credentials](https://plaid.com/docs/auth/coverage/same-day/#reroute-to-credentials) pane should be used in the Link session for the Same Day Micro-deposits flow. As of October 15 2023, the default setting is OPTIONAL. /// [JsonPropertyName("reroute_to_credentials")] public Entity.LinkTokenCreateRequestAuthRerouteToCredentialsEnum? RerouteToCredentials { get; set; } = default!; diff --git a/src/Plaid/Entity/LinkTokenCreateRequestAuthRerouteToCredentialsEnum.cs b/src/Plaid/Entity/LinkTokenCreateRequestAuthRerouteToCredentialsEnum.cs index 55336a99..88eca6f6 100644 --- a/src/Plaid/Entity/LinkTokenCreateRequestAuthRerouteToCredentialsEnum.cs +++ b/src/Plaid/Entity/LinkTokenCreateRequestAuthRerouteToCredentialsEnum.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Entity; /// -/// Specifies what type of Reroute to Credentials pane should be used in the Link session for the Same Day Micro-deposits flow. +/// Specifies what type of [Reroute to Credentials](https://plaid.com/docs/auth/coverage/same-day/#reroute-to-credentials) pane should be used in the Link session for the Same Day Micro-deposits flow. As of October 15 2023, the default setting is OPTIONAL. /// public enum LinkTokenCreateRequestAuthRerouteToCredentialsEnum { diff --git a/src/Plaid/Entity/OmittableTransferType.cs b/src/Plaid/Entity/OmittableTransferType.cs new file mode 100644 index 00000000..cae3e1ba --- /dev/null +++ b/src/Plaid/Entity/OmittableTransferType.cs @@ -0,0 +1,25 @@ +namespace Going.Plaid.Entity; + +/// +/// The type of transfer. Valid values are debit or credit. A debit indicates a transfer of money into the origination account; a credit indicates a transfer of money out of the origination account. This field is omitted for Plaid Ledger Sweep events. +/// +public enum OmittableTransferType +{ + /// + /// + /// + [EnumMember(Value = "debit")] + Debit, + + /// + /// + /// + [EnumMember(Value = "credit")] + Credit, + + /// + /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. + /// + [EnumMember(Value = "undefined")] + Undefined, +} \ No newline at end of file diff --git a/src/Plaid/Entity/PersonalFinanceCategory.cs b/src/Plaid/Entity/PersonalFinanceCategory.cs index 05114d3f..0717a81d 100644 --- a/src/Plaid/Entity/PersonalFinanceCategory.cs +++ b/src/Plaid/Entity/PersonalFinanceCategory.cs @@ -19,13 +19,13 @@ public record PersonalFinanceCategory public string Detailed { get; init; } = default!; /// - /// Note: This field is only available for /transactions/enrich endpoint currently. + /// This field is currently only available for the /transactions/enrich endpoint. /// A description of how confident we are that the provided categories accurately describe the transaction intent. /// VERY_HIGH: We are more than 98% confident that this category reflects the intent of the transaction. /// HIGH: We are more than 90% confident that this category reflects the intent of the transaction. /// MEDIUM: We are moderately confident that this category reflects the intent of the transaction. /// LOW: This category may reflect the intent, but there may be other categories that are more accurate. - /// UNKNOWN: Error + /// UNKNOWN: We don’t know the confidence level for this category. /// [JsonPropertyName("confidence_level")] public string? ConfidenceLevel { get; init; } = default!; diff --git a/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs b/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs index 9efbb50d..349329b8 100644 --- a/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs +++ b/src/Plaid/Entity/ProcessorTokenCreateRequestProcessorEnum.cs @@ -245,6 +245,12 @@ public enum ProcessorTokenCreateRequestProcessorEnum [EnumMember(Value = "teal")] Teal, + /// + /// + /// + [EnumMember(Value = "zero_hash")] + ZeroHash, + /// /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. /// diff --git a/src/Plaid/Entity/SignalWarning.cs b/src/Plaid/Entity/SignalWarning.cs index 4faeadd7..09544fb6 100644 --- a/src/Plaid/Entity/SignalWarning.cs +++ b/src/Plaid/Entity/SignalWarning.cs @@ -12,7 +12,7 @@ public record SignalWarning public string? WarningType { get; init; } = default!; /// - /// The warning code identifies a specific kind of warning that pertains to the error causing bank data to be missing. Safe for programmatic use. For more details on warning codes, please refer to Plaid standard error codes documentation. In case you receive the ITEM_LOGIN_REQUIRED warning, we recommend re-authenticating your user by implementing Link's update mode. This will guide your user to fix their credentials, allowing Plaid to start fetching data again for future Signal requests. + /// The warning code identifies a specific kind of warning that pertains to the error causing bank data to be missing. Safe for programmatic use. For more details on warning codes, please refer to Plaid standard error codes documentation. If you receive the ITEM_LOGIN_REQUIRED warning, we recommend re-authenticating your user by implementing Link's update mode. This will guide your user to fix their credentials, allowing Plaid to start fetching data again for future Signal requests. /// [JsonPropertyName("warning_code")] public string? WarningCode { get; init; } = default!; diff --git a/src/Plaid/Entity/SimulatedTransferSweep.cs b/src/Plaid/Entity/SimulatedTransferSweep.cs index ca473ec9..1502576f 100644 --- a/src/Plaid/Entity/SimulatedTransferSweep.cs +++ b/src/Plaid/Entity/SimulatedTransferSweep.cs @@ -48,4 +48,16 @@ public record SimulatedTransferSweep /// [JsonPropertyName("status")] public Entity.SweepStatus? Status { get; init; } = default!; + + /// + /// The trigger of the sweep + /// + [JsonPropertyName("trigger")] + public Entity.SweepTrigger? Trigger { get; init; } = default!; + + /// + /// The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. + /// + [JsonPropertyName("description")] + public string? Description { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/StatementsAccount.cs b/src/Plaid/Entity/StatementsAccount.cs index 01c2a6d6..ddc251e0 100644 --- a/src/Plaid/Entity/StatementsAccount.cs +++ b/src/Plaid/Entity/StatementsAccount.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Entity; /// -/// Account associated with the item. +/// Account associated with the Item. /// public record StatementsAccount { diff --git a/src/Plaid/Entity/StatementsStatement.cs b/src/Plaid/Entity/StatementsStatement.cs index 46dc8a7c..b2d45174 100644 --- a/src/Plaid/Entity/StatementsStatement.cs +++ b/src/Plaid/Entity/StatementsStatement.cs @@ -18,7 +18,7 @@ public record StatementsStatement public int Month { get; init; } = default!; /// - /// Year. Possible values: 2010-{current_year}. + /// The year of statement. /// [JsonPropertyName("year")] public int Year { get; init; } = default!; diff --git a/src/Plaid/Entity/StudentRepaymentPlanTypeEnum.cs b/src/Plaid/Entity/StudentRepaymentPlanTypeEnum.cs index d1fd1a53..34cc4a27 100644 --- a/src/Plaid/Entity/StudentRepaymentPlanTypeEnum.cs +++ b/src/Plaid/Entity/StudentRepaymentPlanTypeEnum.cs @@ -65,6 +65,12 @@ public enum StudentRepaymentPlanTypeEnum [EnumMember(Value = "standard")] Standard, + /// + /// + /// + [EnumMember(Value = "saving on a valuable education")] + SavingOnAValuableEducation, + /// /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. /// diff --git a/src/Plaid/Entity/SweepTrigger.cs b/src/Plaid/Entity/SweepTrigger.cs new file mode 100644 index 00000000..aef63934 --- /dev/null +++ b/src/Plaid/Entity/SweepTrigger.cs @@ -0,0 +1,37 @@ +namespace Going.Plaid.Entity; + +/// +/// The trigger of the sweep +/// +public enum SweepTrigger +{ + /// + /// The sweep is created manually by the customer + /// + [EnumMember(Value = "manual")] + Manual, + + /// + /// The sweep is created by incoming funds flow (e.g. Incoming Wire) + /// + [EnumMember(Value = "incoming")] + Incoming, + + /// + /// The sweep is created by balance threshold setting + /// + [EnumMember(Value = "balance_threshold")] + BalanceThreshold, + + /// + /// The sweep is created by the Plaid automatic aggregation process. These funds did not pass through the Plaid Ledger balance. + /// + [EnumMember(Value = "automatic_aggregate")] + AutomaticAggregate, + + /// + /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. + /// + [EnumMember(Value = "undefined")] + Undefined, +} \ No newline at end of file diff --git a/src/Plaid/Entity/Transaction.cs b/src/Plaid/Entity/Transaction.cs index 7bfe1e36..3cafdb67 100644 --- a/src/Plaid/Entity/Transaction.cs +++ b/src/Plaid/Entity/Transaction.cs @@ -32,7 +32,7 @@ public record Transaction /// /// A hierarchical array of the categories to which this transaction belongs. For a full list of categories, see /categories/get. - /// All Transactions implementations are recommended to use the new personal_finance_category instead of category. personal_finance_category provides more meaningful categorization and greater accuracy. + /// All Transactions implementations are recommended to use the new personal_finance_category instead of category_id, 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. /// [JsonPropertyName("category")] @@ -121,7 +121,7 @@ public record Transaction public Entity.TransactionTransactionTypeEnum? TransactionType { get; init; } = default!; /// - /// The logo associated with the merchant, if available. Formatted as a 100x100 pixels PNG file path. + /// The URL of a logo associated with the merchant, if available. The logo will always be 100×100 pixel PNG file. /// [JsonPropertyName("logo_url")] public string? LogoUrl { get; init; } = default!; @@ -172,7 +172,7 @@ public record Transaction public Entity.TransactionCode? TransactionCode { get; init; } = default!; /// - /// A link to the icon associated with the primary personal finance category. The logo will always be 100x100 pixels. + /// The URL of an icon associated with the primary personal finance category. The icon will always be 100×100 pixel PNG file. /// [JsonPropertyName("personal_finance_category_icon_url")] public string? PersonalFinanceCategoryIconUrl { get; init; } = default!; @@ -182,4 +182,10 @@ public record Transaction /// [JsonPropertyName("counterparties")] public IReadOnlyList? Counterparties { get; init; } = default!; + + /// + /// A unique, stable, Plaid-generated ID that maps to the merchant. + /// + [JsonPropertyName("merchant_entity_id")] + public string? MerchantEntityId { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/TransactionsGetRequestOptions.cs b/src/Plaid/Entity/TransactionsGetRequestOptions.cs index 68af7de8..b9d6bd25 100644 --- a/src/Plaid/Entity/TransactionsGetRequestOptions.cs +++ b/src/Plaid/Entity/TransactionsGetRequestOptions.cs @@ -45,7 +45,7 @@ public class TransactionsGetRequestOptions public bool? IncludePersonalFinanceCategory { get; set; } = default!; /// - /// Include counterparties and extran merchant fields in the transaction. This field is disabled by default. If you need this information in addition to the parsed data provided, contact your Plaid Account Manager. + /// Include counterparties and extra merchant fields in the response. /// [JsonPropertyName("include_logo_and_counterparty_beta")] public bool? IncludeLogoAndCounterpartyBeta { get; set; } = default!; diff --git a/src/Plaid/Entity/TransactionsSyncRequestOptions.cs b/src/Plaid/Entity/TransactionsSyncRequestOptions.cs index d4dde812..806a98d4 100644 --- a/src/Plaid/Entity/TransactionsSyncRequestOptions.cs +++ b/src/Plaid/Entity/TransactionsSyncRequestOptions.cs @@ -20,7 +20,7 @@ public class TransactionsSyncRequestOptions public bool? IncludePersonalFinanceCategory { get; set; } = default!; /// - /// Include counterparties and extra merchant fields in the transaction. This field is disabled by default. If you need this information in addition to the parsed data provided, contact your Plaid Account Manager. + /// Include counterparties and extra merchant fields in the response. /// [JsonPropertyName("include_logo_and_counterparty_beta")] public bool? IncludeLogoAndCounterpartyBeta { get; set; } = default!; diff --git a/src/Plaid/Entity/TransferACHNetwork.cs b/src/Plaid/Entity/TransferACHNetwork.cs new file mode 100644 index 00000000..1b91a708 --- /dev/null +++ b/src/Plaid/Entity/TransferACHNetwork.cs @@ -0,0 +1,25 @@ +namespace Going.Plaid.Entity; + +/// +/// +/// +public enum TransferACHNetwork +{ + /// + /// + /// + [EnumMember(Value = "ach")] + Ach, + + /// + /// + /// + [EnumMember(Value = "same-day-ach")] + SameDayAch, + + /// + /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. + /// + [EnumMember(Value = "undefined")] + Undefined, +} \ No newline at end of file diff --git a/src/Plaid/Entity/TransferAuthorizationDecisionRationale.cs b/src/Plaid/Entity/TransferAuthorizationDecisionRationale.cs index 6c498f81..1a43f967 100644 --- a/src/Plaid/Entity/TransferAuthorizationDecisionRationale.cs +++ b/src/Plaid/Entity/TransferAuthorizationDecisionRationale.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Entity; public record TransferAuthorizationDecisionRationale { /// - /// A code representing the rationale for approving or declining the proposed transfer. Possible values are: + /// A code representing the rationale for approving or declining the proposed transfer. /// [JsonPropertyName("code")] public Entity.TransferAuthorizationDecisionRationaleCode Code { get; init; } = default!; diff --git a/src/Plaid/Entity/TransferAuthorizationDecisionRationaleCode.cs b/src/Plaid/Entity/TransferAuthorizationDecisionRationaleCode.cs index 223df4de..62df2b91 100644 --- a/src/Plaid/Entity/TransferAuthorizationDecisionRationaleCode.cs +++ b/src/Plaid/Entity/TransferAuthorizationDecisionRationaleCode.cs @@ -1,54 +1,54 @@ namespace Going.Plaid.Entity; /// -/// A code representing the rationale for approving or declining the proposed transfer. Possible values are: +/// A code representing the rationale for approving or declining the proposed transfer. /// public enum TransferAuthorizationDecisionRationaleCode { /// - /// – Transaction likely to result in a return due to insufficient funds. Plaid will offer declined as a transaction decision. + /// – Transaction likely to result in a return due to insufficient funds. /// [EnumMember(Value = "NSF")] Nsf, /// - /// Transaction is high-risk. Plaid will offer declined as a transaction decision. + /// Transaction is high-risk. /// [EnumMember(Value = "RISK")] Risk, /// - /// One or several transfer limits are reached, e.g. monthly transfer limit. Plaid will offer declined as a transaction decision. + /// One or several transfer limits are reached, e.g. monthly transfer limit. /// [EnumMember(Value = "TRANSFER_LIMIT_REACHED")] TransferLimitReached, /// - /// – Item created via same-day micro deposits, limited information available. Plaid will offer approved as a transaction decision. + /// – Item created via same-day micro deposits, limited information available. /// [EnumMember(Value = "MANUALLY_VERIFIED_ITEM")] ManuallyVerifiedItem, /// - /// – Unable to collect the account information due to Item staleness. Can be rectified using Link in update mode. Plaid will offer approved as a transaction decision. + /// – Unable to collect the account information due to Item staleness. Can be resolved by using Link in update mode. /// [EnumMember(Value = "ITEM_LOGIN_REQUIRED")] ItemLoginRequired, /// - /// Unable to collect the account information due to invalid login when using Payment Profiles. Can be rectified using update mode for Payment Profile. Plaid will offer approved as a transaction decision. + /// /// [EnumMember(Value = "PAYMENT_PROFILE_LOGIN_REQUIRED")] PaymentProfileLoginRequired, /// - /// – Unable to collect the account information due to an error. Plaid will offer approved as a transaction decision. + /// – Unable to collect the account information due to an unspecified error. /// [EnumMember(Value = "ERROR")] Error, /// - /// Item created via /transfer/account_migration endpoint, limited information available. Plaid will offer approved as a transaction decision. + /// Item created via /transfer/account_migration endpoint, limited information available. /// [EnumMember(Value = "MIGRATED_ACCOUNT_ITEM")] MigratedAccountItem, diff --git a/src/Plaid/Entity/TransferAuthorizationDevice.cs b/src/Plaid/Entity/TransferAuthorizationDevice.cs index 96a38a02..caecdf02 100644 --- a/src/Plaid/Entity/TransferAuthorizationDevice.cs +++ b/src/Plaid/Entity/TransferAuthorizationDevice.cs @@ -1,18 +1,18 @@ namespace Going.Plaid.Entity; /// -/// Information about the device being used to initiate the authorization. +/// Information about the device being used to initiate the authorization. These fields are not currently incorporated into the risk check. /// public class TransferAuthorizationDevice { /// - /// The IP address of the device being used to initiate the authorization. Required when the end-user is present at authorization create time. + /// The IP address of the device being used to initiate the authorization. /// [JsonPropertyName("ip_address")] public string? IpAddress { get; set; } = default!; /// - /// The user agent of the device being used to initiate the authorization. Required when the end-user is present at authorization create time. + /// The user agent of the device being used to initiate the authorization. /// [JsonPropertyName("user_agent")] public string? UserAgent { get; set; } = default!; diff --git a/src/Plaid/Entity/TransferAuthorizationUserInRequest.cs b/src/Plaid/Entity/TransferAuthorizationUserInRequest.cs index a06746d9..d0da92cb 100644 --- a/src/Plaid/Entity/TransferAuthorizationUserInRequest.cs +++ b/src/Plaid/Entity/TransferAuthorizationUserInRequest.cs @@ -1,30 +1,30 @@ namespace Going.Plaid.Entity; /// -/// The legal name and other information for the account holder. +/// The legal name and other information for the account holder. The user.legal_name field is required. Other fields are not currently used and are present to support planned future functionality. /// public partial class TransferAuthorizationUserInRequest { /// - /// The user's legal name. + /// The user's legal name. If the user is a business, provide the business name. /// [JsonPropertyName("legal_name")] public string LegalName { get; set; } = default!; /// - /// The user's phone number. In order to qualify for a guaranteed transfer, at least one of phone_number or email_address must be provided. + /// The user's phone number. /// [JsonPropertyName("phone_number")] public string? PhoneNumber { get; set; } = default!; /// - /// The user's email address. In order to qualify for a guaranteed transfer, at least one of phone_number or email_address must be provided. + /// The user's email address. /// [JsonPropertyName("email_address")] public string? EmailAddress { get; set; } = default!; /// - /// The address associated with the account holder. Providing this data will improve the likelihood that Plaid will be able to guarantee the transfer, if applicable. + /// The address associated with the account holder. /// [JsonPropertyName("address")] public Entity.TransferUserAddressInRequest? Address { get; set; } = default!; diff --git a/src/Plaid/Entity/TransferEvent.cs b/src/Plaid/Entity/TransferEvent.cs index 31c15f19..7bea3e4a 100644 --- a/src/Plaid/Entity/TransferEvent.cs +++ b/src/Plaid/Entity/TransferEvent.cs @@ -18,16 +18,16 @@ public record TransferEvent public DateTimeOffset Timestamp { get; init; } = default!; /// - /// The type of event that this transfer represents. + /// The type of event that this transfer represents. Event types with prefix sweep represents events for Plaid Ledger sweeps. /// [JsonPropertyName("event_type")] public Entity.TransferEventType EventType { get; init; } = default!; /// - /// The account ID associated with the transfer. + /// The account ID associated with the transfer. This field is omitted for Plaid Ledger Sweep events. /// [JsonPropertyName("account_id")] - public string AccountId { get; init; } = default!; + public string? AccountId { get; init; } = default!; /// /// The id of the associated funding account, available in the Plaid Dashboard. If present, this indicates which of your business checking accounts will be credited or debited. @@ -36,7 +36,7 @@ public record TransferEvent public string? FundingAccountId { get; init; } = default!; /// - /// Plaid’s unique identifier for a transfer. + /// Plaid’s unique identifier for a transfer. This field is null for Plaid Ledger Sweep events. /// [JsonPropertyName("transfer_id")] public string TransferId { get; init; } = default!; @@ -48,16 +48,16 @@ public record TransferEvent public string? OriginationAccountId { get; init; } = default!; /// - /// The type of transfer. This will be either debit or credit. A debit indicates a transfer of money into the origination account; a credit indicates a transfer of money out of the origination account. + /// The type of transfer. Valid values are debit or credit. A debit indicates a transfer of money into the origination account; a credit indicates a transfer of money out of the origination account. This field is omitted for Plaid Ledger Sweep events. /// [JsonPropertyName("transfer_type")] - public Entity.TransferType TransferType { get; init; } = default!; + public Entity.OmittableTransferType? TransferType { get; init; } = default!; /// - /// The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). + /// The amount of the transfer (decimal string with two digits of precision e.g. "10.00"). This field is omitted for Plaid Ledger Sweep events. /// [JsonPropertyName("transfer_amount")] - public string TransferAmount { get; init; } = default!; + public string? TransferAmount { get; init; } = default!; /// /// The failure reason if the event type for a transfer is "failed" or "returned". Null value otherwise. diff --git a/src/Plaid/Entity/TransferEventType.cs b/src/Plaid/Entity/TransferEventType.cs index 8ec5caee..d2b7fdba 100644 --- a/src/Plaid/Entity/TransferEventType.cs +++ b/src/Plaid/Entity/TransferEventType.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Entity; /// -/// The type of event that this transfer represents. +/// The type of event that this transfer represents. Event types with prefix sweep represents events for Plaid Ledger sweeps. /// public enum TransferEventType { @@ -59,6 +59,36 @@ public enum TransferEventType [EnumMember(Value = "return_swept")] ReturnSwept, + /// + /// A new ledger sweep was created; it is in the pending state. + /// + [EnumMember(Value = "sweep.pending")] + SweepPending, + + /// + /// The ledger sweep has been successfully submitted to the payment network. + /// + [EnumMember(Value = "sweep.posted")] + SweepPosted, + + /// + /// The transaction has settled in the funding account. This means that funds withdrawn from Plaid Ledger balance have reached the funding account, or funds to be deposited into the Plaid Ledger Balance have been pulled, and the hold period has begun. + /// + [EnumMember(Value = "sweep.settled")] + SweepSettled, + + /// + /// A posted ledger sweep was returned. + /// + [EnumMember(Value = "sweep.returned")] + SweepReturned, + + /// + /// The ledger sweep failed, no funds were moved. + /// + [EnumMember(Value = "sweep.failed")] + SweepFailed, + /// /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. /// diff --git a/src/Plaid/Entity/TransferFundingAccount.cs b/src/Plaid/Entity/TransferFundingAccount.cs new file mode 100644 index 00000000..8d7bcbf4 --- /dev/null +++ b/src/Plaid/Entity/TransferFundingAccount.cs @@ -0,0 +1,19 @@ +namespace Going.Plaid.Entity; + +/// +/// The originator's funding account, linked with Plaid Link or /transfer/migrate_account. +/// +public class TransferFundingAccount +{ + /// + /// The access token associated with the Item data is being requested for. + /// + [JsonPropertyName("access_token")] + public string AccessToken { get; set; } = default!; + + /// + /// The Plaid account_id for the newly created Item. + /// + [JsonPropertyName("account_id")] + public string AccountId { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Entity/TransferLedgerSweepSimulateEventType.cs b/src/Plaid/Entity/TransferLedgerSweepSimulateEventType.cs new file mode 100644 index 00000000..95ccebec --- /dev/null +++ b/src/Plaid/Entity/TransferLedgerSweepSimulateEventType.cs @@ -0,0 +1,43 @@ +namespace Going.Plaid.Entity; + +/// +/// The asynchronous event to be simulated. May be: posted, settled, failed, or returned. +/// An error will be returned if the event type is incompatible with the current ledger sweep status. Compatible status --> event type transitions include: +/// pending --> posted +/// pending --> failed +/// posted --> settled +/// posted --> returned +/// settled --> returned +/// +public enum TransferLedgerSweepSimulateEventType +{ + /// + /// + /// + [EnumMember(Value = "sweep.posted")] + SweepPosted, + + /// + /// + /// + [EnumMember(Value = "sweep.settled")] + SweepSettled, + + /// + /// + /// + [EnumMember(Value = "sweep.returned")] + SweepReturned, + + /// + /// + /// + [EnumMember(Value = "sweep.failed")] + SweepFailed, + + /// + /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. + /// + [EnumMember(Value = "undefined")] + Undefined, +} \ No newline at end of file diff --git a/src/Plaid/Entity/TransferOriginatorDiligence.cs b/src/Plaid/Entity/TransferOriginatorDiligence.cs index bb9768b2..15d72701 100644 --- a/src/Plaid/Entity/TransferOriginatorDiligence.cs +++ b/src/Plaid/Entity/TransferOriginatorDiligence.cs @@ -46,4 +46,10 @@ public class TransferOriginatorDiligence /// [JsonPropertyName("naics_code")] public string NaicsCode { get; set; } = default!; + + /// + /// The originator's funding account, linked with Plaid Link or /transfer/migrate_account. + /// + [JsonPropertyName("funding_account")] + public Entity.TransferFundingAccount FundingAccount { get; set; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/TransferRecurringSchedule.cs b/src/Plaid/Entity/TransferRecurringSchedule.cs index 06b22723..eecf771a 100644 --- a/src/Plaid/Entity/TransferRecurringSchedule.cs +++ b/src/Plaid/Entity/TransferRecurringSchedule.cs @@ -12,8 +12,8 @@ public class TransferRecurringSchedule public Entity.TransferScheduleIntervalUnit IntervalUnit { get; set; } = default!; /// - /// The number of recurring interval_units between originations. The recurring interval(before holiday adjustment) is calculated by multiplying interval_unit and interval_count. - /// For instance, to schedule a recurring transfer which originates once every two weeks, set interval_unit = week and interval_count = 2. + /// The number of recurring interval_units between originations. The recurring interval (before holiday adjustment) is calculated by multiplying interval_unit and interval_count. + /// For example, to schedule a recurring transfer which originates once every two weeks, set interval_unit = week and interval_count = 2. /// [JsonPropertyName("interval_count")] public int IntervalCount { get; set; } = default!; @@ -22,7 +22,7 @@ public class TransferRecurringSchedule /// The day of the interval on which to schedule the transfer. /// If the interval_unit is week, interval_execution_day should be an integer from 1 (Monday) to 5 (Friday). /// If the interval_unit is month, interval_execution_day should be an integer indicating which day of the month to make the transfer on. Integers from 1 to 28 can be used to make a transfer on that day of the month. Negative integers from -1 to -5 can be used to make a transfer relative to the end of the month. To make a transfer on the last day of the month, use -1; to make the transfer on the second-to-last day, use -2, and so on. - /// The transfer will be originated on next available banking day if the designated day is a non banking day. + /// The transfer will be originated on the next available banking day if the designated day is a non banking day. /// [JsonPropertyName("interval_execution_day")] public int IntervalExecutionDay { get; set; } = default!; diff --git a/src/Plaid/Entity/TransferSweep.cs b/src/Plaid/Entity/TransferSweep.cs index 2aa9746b..9a25ec0f 100644 --- a/src/Plaid/Entity/TransferSweep.cs +++ b/src/Plaid/Entity/TransferSweep.cs @@ -50,4 +50,16 @@ public record TransferSweep /// [JsonPropertyName("status")] public Entity.SweepStatus? Status { get; init; } = default!; + + /// + /// The trigger of the sweep + /// + [JsonPropertyName("trigger")] + public Entity.SweepTrigger? Trigger { get; init; } = default!; + + /// + /// The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. + /// + [JsonPropertyName("description")] + public string? Description { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Entity/TransferUserAddressInRequest.cs b/src/Plaid/Entity/TransferUserAddressInRequest.cs index 4732a0ed..ce4a7f9f 100644 --- a/src/Plaid/Entity/TransferUserAddressInRequest.cs +++ b/src/Plaid/Entity/TransferUserAddressInRequest.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Entity; /// -/// The address associated with the account holder. Providing this data will improve the likelihood that Plaid will be able to guarantee the transfer, if applicable. +/// The address associated with the account holder. /// public partial class TransferUserAddressInRequest { diff --git a/src/Plaid/Entity/TransferUserInRequest.cs b/src/Plaid/Entity/TransferUserInRequest.cs index df5bc458..5b0cd34e 100644 --- a/src/Plaid/Entity/TransferUserInRequest.cs +++ b/src/Plaid/Entity/TransferUserInRequest.cs @@ -24,7 +24,7 @@ public partial class TransferUserInRequest public string? EmailAddress { get; set; } = default!; /// - /// The address associated with the account holder. Providing this data will improve the likelihood that Plaid will be able to guarantee the transfer, if applicable. + /// The address associated with the account holder. /// [JsonPropertyName("address")] public Entity.TransferUserAddressInRequest? Address { get; set; } = default!; diff --git a/src/Plaid/Entity/TransferUserInRequestDeprecated.cs b/src/Plaid/Entity/TransferUserInRequestDeprecated.cs index ccf90f40..475beaff 100644 --- a/src/Plaid/Entity/TransferUserInRequestDeprecated.cs +++ b/src/Plaid/Entity/TransferUserInRequestDeprecated.cs @@ -24,7 +24,7 @@ public class TransferUserInRequestDeprecated public string? EmailAddress { get; set; } = default!; /// - /// The address associated with the account holder. Providing this data will improve the likelihood that Plaid will be able to guarantee the transfer, if applicable. + /// The address associated with the account holder. /// [JsonPropertyName("address")] public Entity.TransferUserAddressInRequest? Address { get; set; } = default!; diff --git a/src/Plaid/Entity/WebhookCode.cs b/src/Plaid/Entity/WebhookCode.cs index 65f433c3..4debb999 100644 --- a/src/Plaid/Entity/WebhookCode.cs +++ b/src/Plaid/Entity/WebhookCode.cs @@ -197,6 +197,12 @@ public enum WebhookCode [EnumMember(Value = "LINK_CALLBACK")] LinkCallback, + /// + /// + /// + [EnumMember(Value = "BANK_INCOME_COMPLETE")] + BankIncomeComplete, + /// /// /// @@ -221,12 +227,6 @@ public enum WebhookCode [EnumMember(Value = "SESSION_FINISHED")] SessionFinished, - /// - /// - /// - [EnumMember(Value = "BANK_INCOME_COMPLETE")] - BankIncomeComplete, - /// /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. /// diff --git a/src/Plaid/Entity/WebhookType.cs b/src/Plaid/Entity/WebhookType.cs index ba1da8c0..cfb4fb6c 100644 --- a/src/Plaid/Entity/WebhookType.cs +++ b/src/Plaid/Entity/WebhookType.cs @@ -116,26 +116,26 @@ public enum WebhookType /// /// /// - [EnumMember(Value = "LINK")] - Link, + [EnumMember(Value = "BASE_REPORT")] + BaseReport, /// /// /// - [EnumMember(Value = "ASSETS")] - Assets, + [EnumMember(Value = "CRA_INCOME")] + CraIncome, /// /// /// - [EnumMember(Value = "BASE_REPORT")] - BaseReport, + [EnumMember(Value = "LINK")] + Link, /// /// /// - [EnumMember(Value = "CRA_INCOME")] - CraIncome, + [EnumMember(Value = "ASSETS")] + Assets, /// /// Catch-all for unknown values returned by Plaid. If you encounter this, please check if there is a later version of the Going.Plaid library. diff --git a/src/Plaid/Link/LinkTokenCreateRequest.cs b/src/Plaid/Link/LinkTokenCreateRequest.cs index b70f4c9b..e726c4d0 100644 --- a/src/Plaid/Link/LinkTokenCreateRequest.cs +++ b/src/Plaid/Link/LinkTokenCreateRequest.cs @@ -43,23 +43,24 @@ public partial class LinkTokenCreateRequest : RequestBase [JsonPropertyName("products")] public IReadOnlyList? Products { get; set; } = default!; + /// + /// List of Plaid product(s) you wish to use only if the institution and account(s) selected by the user support the product. Institutions that do not support these products will still be shown in Link. The products will only be extracted and billed if the user selects an institution and account type that supports them. + /// There should be no overlap between this array and the products or additional_consented_products arrays. The products array must have at least one product. + /// For more details on using this feature, see Required if Supported Products. + /// + [JsonPropertyName("required_if_supported_products")] + public IReadOnlyList? RequiredIfSupportedProducts { get; set; } = default!; + /// /// (Beta) This field has no effect unless you are participating in the Data Transparency beta program. /// List of additional Plaid product(s) you wish to collect consent for. These products will not be billed until you start using them by calling the relevant endpoints. /// balance is *not* a valid value, the Balance product does not require explicit initialization and will automatically have consent collected. - /// Institutions that do not support these products will still be shown in Link + /// Institutions that do not support these products will still be shown in Link. + /// There should be no overlap between this array and the products or required_if_supported_products arrays. /// [JsonPropertyName("additional_consented_products")] public IReadOnlyList? AdditionalConsentedProducts { get; set; } = default!; - /// - /// List of Plaid product(s) you wish to use only if the institution and account(s) selected by the user support the product. Institutions that do not support these products will still be shown in Link. The products will only be extracted and billed if the user selects an institution and account type that supports them. - /// There should be no overlap between products and required_if_supported_products. The products array must have at least one product. - /// For more details on using this feature, see Required if Supported Products. - /// - [JsonPropertyName("required_if_supported_products")] - public IReadOnlyList? RequiredIfSupportedProducts { get; set; } = default!; - /// /// The destination URL to which any webhooks should be sent. Note that webhooks for Payment Initiation (e-wallet transactions only), Transfer, Bank Transfer (including Auth micro-deposit notification webhooks) and Identity Verification are configured via the Dashboard instead. /// diff --git a/src/Plaid/Processor/PlaidClient.cs b/src/Plaid/Processor/PlaidClient.cs index cf3b2526..3d08e129 100644 --- a/src/Plaid/Processor/PlaidClient.cs +++ b/src/Plaid/Processor/PlaidClient.cs @@ -11,6 +11,15 @@ public sealed partial class PlaidClient PostAsync("/processor/auth/get", request) .ParseResponseAsync(); + /// + /// This endpoint returns the account associated with a given processor token. + /// This endpoint retrieves cached information, rather than extracting fresh information from the institution. As a result, the account balance returned may not be up-to-date; for realtime balance information, use /processor/balance/get instead. Note that some information is nullable. + /// + /// + public Task ProcessorAccountGetAsync(Processor.ProcessorAccountGetRequest request) => + PostAsync("/processor/account/get", request) + .ParseResponseAsync(); + /// /// The /processor/transactions/get endpoint allows developers to receive user-authorized transaction data for credit, depository, and some loan-type accounts (only those with account subtype student; coverage may be limited). Transaction data is standardized across financial institutions, and in many cases transactions are linked to a clean name, entity type, location, and category. Similarly, account data is standardized and returned with a clean name, number, balance, and other meta information where available. /// Transactions are returned in reverse-chronological order, and the sequence of transaction ordering is stable and will not shift. Transactions are not immutable and can also be removed altogether by the institution; a removed transaction will no longer appear in /processor/transactions/get. For more details, see Pending and posted transactions. @@ -146,7 +155,7 @@ public sealed partial class PlaidClient .ParseResponseAsync(); /// - /// This endpoint allows you to update the webhook URL associated with a processor token. This request triggers a WEBHOOK_UPDATE_ACKNOWLEDGED webhook to the newly specified webhook URL. + /// This endpoint allows you, the processor, to update the webhook URL associated with a processor token. This request triggers a WEBHOOK_UPDATE_ACKNOWLEDGED webhook to the newly specified webhook URL. /// /// public Task ProcessorTokenWebhookUpdateAsync(Processor.ProcessorTokenWebhookUpdateRequest request) => diff --git a/src/Plaid/Processor/ProcessorAccountGetRequest.cs b/src/Plaid/Processor/ProcessorAccountGetRequest.cs new file mode 100644 index 00000000..203c3e75 --- /dev/null +++ b/src/Plaid/Processor/ProcessorAccountGetRequest.cs @@ -0,0 +1,13 @@ +namespace Going.Plaid.Processor; + +/// +/// ProcessorAccountGetRequest defines the request schema for /processor/account/get +/// +public partial class ProcessorAccountGetRequest : RequestBase +{ + /// + /// The processor token obtained from the Plaid integration partner. Processor tokens are in the format: processor-<environment>-<identifier> + /// + [JsonPropertyName("processor_token")] + public string ProcessorToken { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Processor/ProcessorAccountGetResponse.cs b/src/Plaid/Processor/ProcessorAccountGetResponse.cs new file mode 100644 index 00000000..1eaf3bf7 --- /dev/null +++ b/src/Plaid/Processor/ProcessorAccountGetResponse.cs @@ -0,0 +1,13 @@ +namespace Going.Plaid.Processor; + +/// +/// ProcessorAccountGetResponse defines the response schema for /processor/account/get +/// +public record ProcessorAccountGetResponse : ResponseBase +{ + /// + /// A single account at a financial institution. + /// + [JsonPropertyName("account")] + public Entity.Account Account { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Sandbox/PlaidClient.cs b/src/Plaid/Sandbox/PlaidClient.cs index 26cecf75..96e108ea 100644 --- a/src/Plaid/Sandbox/PlaidClient.cs +++ b/src/Plaid/Sandbox/PlaidClient.cs @@ -23,11 +23,12 @@ public sealed partial class PlaidClient /// DEFAULT_UPDATE: Transactions update webhook to be fired for a given Sandbox Item. If the Item does not support Transactions, a SANDBOX_PRODUCT_NOT_ENABLED error will result. /// NEW_ACCOUNTS_AVAILABLE: Webhook to be fired for a given Sandbox Item created with Account Select v2. /// AUTH_DATA_UPDATE: Webhook to be fired for a given Sandbox Item created with Auth as an enabled product. + /// LOGIN_REPAIRED: Fired when an Item recovers from the ITEM_LOGIN_REQUIRED without the user going through update mode in your app. /// RECURRING_TRANSACTIONS_UPDATE: Recurring Transactions webhook to be fired for a given Sandbox Item. If the Item does not support Recurring Transactions, a SANDBOX_PRODUCT_NOT_ENABLED error will result. /// SYNC_UPDATES_AVAILABLE: Transactions webhook to be fired for a given Sandbox Item. If the Item does not support Transactions, a SANDBOX_PRODUCT_NOT_ENABLED error will result. /// PRODUCT_READY: Assets webhook to be fired when a given asset report has been successfully generated. If the Item does not support Assets, a SANDBOX_PRODUCT_NOT_ENABLED error will result. /// ERROR: Assets webhook to be fired when asset report generation has failed. If the Item does not support Assets, a SANDBOX_PRODUCT_NOT_ENABLED error will result. - /// Note that this endpoint is provided for developer ease-of-use and is not required for testing webhooks; webhooks will also fire in Sandbox under the same conditions that they would in Production or Development. + /// Note that this endpoint is provided for developer ease-of-use and is not required for testing webhooks; webhooks will also fire in Sandbox under the same conditions that they would in Production or Development (except for webhooks of type TRANSFER). /// /// public Task SandboxItemFireWebhookAsync(Sandbox.SandboxItemFireWebhookRequest request) => @@ -77,6 +78,30 @@ public sealed partial class PlaidClient PostAsync("/sandbox/transfer/simulate", request) .ParseResponseAsync(); + /// + /// Use the /sandbox/transfer/ledger/simulate_available endpoint to simulate converting pending balance to available balance for all originators in the Sandbox environment. + /// + /// + public Task SandboxTransferLedgerSimulateAvailableAsync(Sandbox.SandboxTransferLedgerSimulateAvailableRequest request) => + PostAsync("/sandbox/transfer/ledger/simulate_available", request) + .ParseResponseAsync(); + + /// + /// Use the /sandbox/transfer/ledger/deposit/simulate endpoint to simulate a ledger deposit event in the Sandbox environment. + /// + /// + public Task SandboxTransferLedgerDepositSimulateAsync(Sandbox.SandboxTransferLedgerDepositSimulateRequest request) => + PostAsync("/sandbox/transfer/ledger/deposit/simulate", request) + .ParseResponseAsync(); + + /// + /// Use the /sandbox/transfer/ledger/withdraw/simulate endpoint to simulate a ledger withdraw event in the Sandbox environment. + /// + /// + public Task SandboxTransferLedgerWithdrawSimulateAsync(Sandbox.SandboxTransferLedgerWithdrawSimulateRequest request) => + PostAsync("/sandbox/transfer/ledger/withdraw/simulate", request) + .ParseResponseAsync(); + /// /// Use the /sandbox/transfer/repayment/simulate endpoint to trigger the creation of a repayment. As a side effect of calling this route, a repayment is created that includes all unreimbursed returns of guaranteed transfers. If there are no such returns, an 400 error is returned. /// @@ -86,7 +111,7 @@ public sealed partial class PlaidClient .ParseResponseAsync(); /// - /// Use the /sandbox/transfer/fire_webhook endpoint to manually trigger a Transfer webhook in the Sandbox environment. + /// Use the /sandbox/transfer/fire_webhook endpoint to manually trigger a TRANSFER_EVENTS_UPDATE webhook in the Sandbox environment. /// /// public Task SandboxTransferFireWebhookAsync(Sandbox.SandboxTransferFireWebhookRequest request) => @@ -107,9 +132,9 @@ public sealed partial class PlaidClient /// Use the /sandbox/transfer/test_clock/advance endpoint to advance a test_clock in the Sandbox environment. /// A test clock object represents an independent timeline and has a virtual_time field indicating the current timestamp of the timeline. A test clock can be advanced by incrementing virtual_time, but may never go back to a lower virtual_time. /// If a test clock is advanced, we will simulate the changes that ought to occur during the time that elapsed. - /// For instance, a client creates a weekly recurring transfer with a test clock set at t. When the client advances the test clock by setting virtual_time = t + 15 days, 2 new originations should be created, along with the webhook events. + /// For example, a client creates a weekly recurring transfer with a test clock set at t. When the client advances the test clock by setting virtual_time = t + 15 days, 2 new originations should be created, along with the webhook events. /// The advancement of the test clock from its current virtual_time should be limited such that there are no more than 20 originations resulting from the advance operation on each recurring_transfer associated with the test_clock. - /// For instance, if the recurring transfer associated with this test clock originates once every 4 weeks, you can advance the virtual_time up to 80 weeks on each API call. + /// For example, if the recurring transfer associated with this test clock originates once every 4 weeks, you can advance the virtual_time up to 80 weeks on each API call. /// /// public Task SandboxTransferTestClockAdvanceAsync(Sandbox.SandboxTransferTestClockAdvanceRequest request) => diff --git a/src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateRequest.cs b/src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateRequest.cs new file mode 100644 index 00000000..7840999d --- /dev/null +++ b/src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateRequest.cs @@ -0,0 +1,31 @@ +namespace Going.Plaid.Sandbox; + +/// +/// Defines the request schema for /sandbox/transfer/ledger/deposit/simulate +/// +public partial class SandboxTransferLedgerDepositSimulateRequest : RequestBase +{ + /// + /// Plaid’s unique identifier for a sweep. + /// + [JsonPropertyName("sweep_id")] + public string SweepId { get; set; } = default!; + + /// + /// The asynchronous event to be simulated. May be: posted, settled, failed, or returned. + /// An error will be returned if the event type is incompatible with the current ledger sweep status. Compatible status --> event type transitions include: + /// pending --> posted + /// pending --> failed + /// posted --> settled + /// posted --> returned + /// settled --> returned + /// + [JsonPropertyName("event_type")] + public Entity.TransferLedgerSweepSimulateEventType EventType { get; set; } = default!; + + /// + /// The failure reason if the event type for a transfer is "failed" or "returned". Null value otherwise. + /// + [JsonPropertyName("failure_reason")] + public Entity.TransferFailure? FailureReason { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateResponse.cs b/src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateResponse.cs new file mode 100644 index 00000000..698780aa --- /dev/null +++ b/src/Plaid/Sandbox/SandboxTransferLedgerDepositSimulateResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Sandbox; + +/// +/// Defines the response schema for /sandbox/transfer/ledger/deposit/simulate +/// +public record SandboxTransferLedgerDepositSimulateResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableRequest.cs b/src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableRequest.cs new file mode 100644 index 00000000..9bbb0ed5 --- /dev/null +++ b/src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableRequest.cs @@ -0,0 +1,13 @@ +namespace Going.Plaid.Sandbox; + +/// +/// Defines the request schema for /sandbox/transfer/ledger/simulate_available +/// +public partial class SandboxTransferLedgerSimulateAvailableRequest : RequestBase +{ + /// + /// Plaid’s unique identifier for a test clock. If provided, only the pending balance that is due before the virtual_timestamp on the test clock will be converted. + /// + [JsonPropertyName("test_clock_id")] + public string? TestClockId { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableResponse.cs b/src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableResponse.cs new file mode 100644 index 00000000..1ed68d6e --- /dev/null +++ b/src/Plaid/Sandbox/SandboxTransferLedgerSimulateAvailableResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Sandbox; + +/// +/// Defines the response schema for /sandbox/transfer/ledger/simulate_available +/// +public record SandboxTransferLedgerSimulateAvailableResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateRequest.cs b/src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateRequest.cs new file mode 100644 index 00000000..178e5029 --- /dev/null +++ b/src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateRequest.cs @@ -0,0 +1,31 @@ +namespace Going.Plaid.Sandbox; + +/// +/// Defines the request schema for /sandbox/transfer/ledger/withdraw/simulate +/// +public partial class SandboxTransferLedgerWithdrawSimulateRequest : RequestBase +{ + /// + /// Plaid’s unique identifier for a sweep. + /// + [JsonPropertyName("sweep_id")] + public string SweepId { get; set; } = default!; + + /// + /// The asynchronous event to be simulated. May be: posted, settled, failed, or returned. + /// An error will be returned if the event type is incompatible with the current ledger sweep status. Compatible status --> event type transitions include: + /// pending --> posted + /// pending --> failed + /// posted --> settled + /// posted --> returned + /// settled --> returned + /// + [JsonPropertyName("event_type")] + public Entity.TransferLedgerSweepSimulateEventType EventType { get; set; } = default!; + + /// + /// The failure reason if the event type for a transfer is "failed" or "returned". Null value otherwise. + /// + [JsonPropertyName("failure_reason")] + public Entity.TransferFailure? FailureReason { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateResponse.cs b/src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateResponse.cs new file mode 100644 index 00000000..d94fbeaa --- /dev/null +++ b/src/Plaid/Sandbox/SandboxTransferLedgerWithdrawSimulateResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Sandbox; + +/// +/// Defines the response schema for /sandbox/transfer/ledger/withdraw/simulate +/// +public record SandboxTransferLedgerWithdrawSimulateResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Signal/PlaidClient.cs b/src/Plaid/Signal/PlaidClient.cs index 8fb2c646..2c934644 100644 --- a/src/Plaid/Signal/PlaidClient.cs +++ b/src/Plaid/Signal/PlaidClient.cs @@ -13,7 +13,7 @@ public sealed partial class PlaidClient .ParseResponseAsync(); /// - /// After calling /signal/evaluate, call /signal/decision/report to report whether the transaction was initiated. This endpoint will return an INVALID_FIELD error if called a second time with a different value for initiated. + /// After calling /signal/evaluate, call /signal/decision/report to report whether the transaction was initiated. /// /// public Task SignalDecisionReportAsync(Signal.SignalDecisionReportRequest request) => @@ -32,6 +32,7 @@ public sealed partial class PlaidClient /// When Link is not initialized with Signal, call /signal/prepare to opt-in that Item to the Signal data collection process, developing a Signal score. /// If you are using other Plaid products after Link, e.g. Identity or Assets, call /signal/prepare after those product calls are complete. /// Example flow: Link is initialized with Auth, call /auth/get for the account and routing number, call /identity/get to retrieve bank ownership details, then call /signal/prepare to begin Signal data collection. Later, once you have obtained details about the proposed transaction from the user, call /signal/evaluate for a Signal score. For more information please see Recommendations for initializing Link with specific product combinations. + /// If run on an Item that is already initialized with Signal, this endpoint will return a 200 response and will not modify the Item. /// /// public Task SignalPrepareAsync(Signal.SignalPrepareRequest request) => diff --git a/src/Plaid/Statements/PlaidClient.cs b/src/Plaid/Statements/PlaidClient.cs index 39d963f2..49eb2d36 100644 --- a/src/Plaid/Statements/PlaidClient.cs +++ b/src/Plaid/Statements/PlaidClient.cs @@ -5,15 +5,15 @@ public sealed partial class PlaidClient /// /// The /statements/list endpoint retrieves a list of all statements associated with the provided item. /// - /// + /// public Task StatementsListAsync(Statements.StatementsListRequest request) => PostAsync("/statements/list", request) .ParseResponseAsync(); /// - /// The /statements/download endpoint retrieves a single statement. + /// The /statements/download endpoint retrieves a single statement PDF in binary format. The response will contain a Plaid-Content-Hash header containing a SHA 256 checksum of the statement. This can be used to verify that the file being sent by Plaid is the same file that was downloaded to your system. /// - /// + /// public Task StatementsDownloadAsync(Statements.StatementsDownloadRequest request) => PostAsync("/statements/download", request) .ParseResponseAsync(); diff --git a/src/Plaid/Transfer/PlaidClient.cs b/src/Plaid/Transfer/PlaidClient.cs index 29f18e3c..db5a4df3 100644 --- a/src/Plaid/Transfer/PlaidClient.cs +++ b/src/Plaid/Transfer/PlaidClient.cs @@ -19,14 +19,14 @@ public sealed partial class PlaidClient .ParseResponseAsync(); /// - /// Use the /transfer/authorization/create endpoint to determine transfer failure risk. + /// Use the /transfer/authorization/create endpoint to authorize a transfer. This endpoint must be called prior to calling /transfer/create. + /// There are three possible outcomes to calling this endpoint: If the authorization.decision in the response is declined, the proposed transfer has failed the risk check and you cannot proceed with the transfer. If the authorization.decision is approved, and the authorization.rationale_code is null, the transfer has passed the risk check and you can proceed to call /transfer/create. If the authorization.decision is approved and the authorization.rationale_code is non-null, the risk check could not be run: you may proceed with the transfer, but should perform your own risk evaluation. For more details, see the response schema. /// In Plaid's Sandbox environment the decisions will be returned as follows: - /// - To approve a transfer with null rationale code, make an authorization request with an amount less than the available balance in the account. + /// - To approve a transfer with null rationale code, make an authorization request with an amount less than the available balance in the account. /// - To approve a transfer with the rationale code MANUALLY_VERIFIED_ITEM, create an Item in Link through the Same Day Micro-deposits flow. /// - To approve a transfer with the rationale code ITEM_LOGIN_REQUIRED, reset the login for an Item. /// - To decline a transfer with the rationale code NSF, the available balance on the account must be less than the authorization amount. See Create Sandbox test data for details on how to customize data in Sandbox. /// - To decline a transfer with the rationale code RISK, the available balance on the account must be exactly $0. See Create Sandbox test data for details on how to customize data in Sandbox. - /// The fields device.ip_address and device.user_agent are required for all sessions where the end-user is present. For example, when a user is authorizing a one-time payment from their device. /// /// public Task TransferAuthorizationCreateAsync(Transfer.TransferAuthorizationCreateRequest request) => @@ -65,6 +65,30 @@ public sealed partial class PlaidClient PostAsync("/transfer/ledger/get", request) .ParseResponseAsync(); + /// + /// Use the /transfer/ledger/deposit endpoint to deposit funds into Plaid Ledger. + /// + /// + public Task TransferLedgerDepositAsync(Transfer.TransferLedgerDepositRequest request) => + PostAsync("/transfer/ledger/deposit", request) + .ParseResponseAsync(); + + /// + /// Use the /transfer/ledger/withdraw endpoint to withdraw funds from a Plaid Ledger balance. + /// + /// + public Task TransferLedgerWithdrawAsync(Transfer.TransferLedgerWithdrawRequest request) => + PostAsync("/transfer/ledger/withdraw", request) + .ParseResponseAsync(); + + /// + /// Use the /transfer/originator/funding_account/update endpoint to update the funding account associated with the originator. + /// + /// + public Task TransferOriginatorFundingAccountUpdateAsync(Transfer.TransferOriginatorFundingAccountUpdateRequest request) => + PostAsync("/transfer/originator/funding_account/update", request) + .ParseResponseAsync(); + /// /// Use the /transfer/metrics/get endpoint to view your transfer product usage metrics. /// diff --git a/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs b/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs index e5ca917e..d145fd3e 100644 --- a/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs +++ b/src/Plaid/Transfer/TransferAuthorizationCreateRequest.cs @@ -6,13 +6,13 @@ namespace Going.Plaid.Transfer; public partial class TransferAuthorizationCreateRequest : RequestBase { /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. /// [JsonPropertyName("account_id")] - public string? AccountId { get; set; } = default!; + public string AccountId { get; set; } = default!; /// - /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. + /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. You can find your list of funding_account_ids in the Accounts page of your Plaid Dashboard, under the "Account ID" column. /// [JsonPropertyName("funding_account_id")] public string? FundingAccountId { get; set; } = default!; @@ -48,13 +48,13 @@ public partial class TransferAuthorizationCreateRequest : RequestBase public Entity.AchClass? AchClass { get; set; } = default!; /// - /// The legal name and other information for the account holder. + /// The legal name and other information for the account holder. The user.legal_name field is required. Other fields are not currently used and are present to support planned future functionality. /// [JsonPropertyName("user")] public Entity.TransferAuthorizationUserInRequest User { get; set; } = default!; /// - /// Information about the device being used to initiate the authorization. + /// Information about the device being used to initiate the authorization. These fields are not currently incorporated into the risk check. /// [JsonPropertyName("device")] public Entity.TransferAuthorizationDevice? Device { get; set; } = default!; @@ -75,13 +75,12 @@ public partial class TransferAuthorizationCreateRequest : RequestBase /// A random key provided by the client, per unique authorization, which expires after 48 hours. Maximum of 50 characters. /// The API supports idempotency for safely retrying requests without accidentally performing the same operation twice. For example, if a request to create an authorization fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single authorization is created. /// This idempotency key expires after 48 hours, after which the same key can be reused. Failure to provide this key may result in duplicate charges. - /// Required for guaranteed ACH customers. /// [JsonPropertyName("idempotency_key")] public string? IdempotencyKey { get; set; } = default!; /// - /// If the end user is initiating the specific transfer themselves via an interactive UI, this should be true; for automatic recurring payments where the end user is not actually initiating each individual transfer, it should be false. + /// If the end user is initiating the specific transfer themselves via an interactive UI, this should be true; for automatic recurring payments where the end user is not actually initiating each individual transfer, it should be false. This field is not currently used and is present to support planned future functionality. /// [JsonPropertyName("user_present")] public bool? UserPresent { get; set; } = default!; @@ -111,7 +110,7 @@ public partial class TransferAuthorizationCreateRequest : RequestBase public Entity.TransferCreditFundsSource? CreditFundsSource { get; set; } = default!; /// - /// Plaid’s unique identifier for a test clock. This field may only be used when using sandbox environment. If provided, the authorization is created at the virtual_time on the provided test_clock. + /// Plaid’s unique identifier for a test clock. This field may only be used when using sandbox environment. If provided, the authorization is created at the virtual_time on the provided test clock. /// [JsonPropertyName("test_clock_id")] public string? TestClockId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs b/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs index 80aaaf7d..78f10f1e 100644 --- a/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs +++ b/src/Plaid/Transfer/TransferCapabilitiesGetRequest.cs @@ -6,7 +6,7 @@ namespace Going.Plaid.Transfer; public partial class TransferCapabilitiesGetRequest : RequestBase { /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. /// [JsonPropertyName("account_id")] public string? AccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferCreateRequest.cs b/src/Plaid/Transfer/TransferCreateRequest.cs index f1bf2c1a..11daa4cd 100644 --- a/src/Plaid/Transfer/TransferCreateRequest.cs +++ b/src/Plaid/Transfer/TransferCreateRequest.cs @@ -14,17 +14,11 @@ public partial class TransferCreateRequest : RequestBase public string? IdempotencyKey { get; set; } = default!; /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. /// [JsonPropertyName("account_id")] public string? AccountId { get; set; } = default!; - /// - /// The payment profile token associated with the Payment Profile that will be debited or credited. Required if not using access_token. - /// - [JsonPropertyName("payment_profile_token")] - public string? PaymentProfileToken { get; set; } = default!; - /// /// Plaid’s unique identifier for a transfer authorization. This parameter also serves the purpose of acting as an idempotency identifier. /// diff --git a/src/Plaid/Transfer/TransferIntentCreateRequest.cs b/src/Plaid/Transfer/TransferIntentCreateRequest.cs index a5e99275..0dced378 100644 --- a/src/Plaid/Transfer/TransferIntentCreateRequest.cs +++ b/src/Plaid/Transfer/TransferIntentCreateRequest.cs @@ -12,7 +12,7 @@ public partial class TransferIntentCreateRequest : RequestBase public string? AccountId { get; set; } = default!; /// - /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. + /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. You can find your list of funding_account_ids in the Accounts page of your Plaid Dashboard, under the "Account ID" column. /// [JsonPropertyName("funding_account_id")] public string? FundingAccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferLedgerDepositRequest.cs b/src/Plaid/Transfer/TransferLedgerDepositRequest.cs new file mode 100644 index 00000000..28bd4661 --- /dev/null +++ b/src/Plaid/Transfer/TransferLedgerDepositRequest.cs @@ -0,0 +1,44 @@ +namespace Going.Plaid.Transfer; + +/// +/// Defines the request schema for /transfer/ledger/deposit +/// +public partial class TransferLedgerDepositRequest : RequestBase +{ + /// + /// Client ID of the customer that owns the Ledger balance. This is so Plaid knows which of your customers to payout or collect funds. Only applicable for Platform customers. Do not include if you’re paying out to yourself. + /// + [JsonPropertyName("originator_client_id")] + public string? OriginatorClientId { get; set; } = default!; + + /// + /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. You can find your list of funding_account_ids in the Accounts page of your Plaid Dashboard, under the "Account ID" column. + /// + [JsonPropertyName("funding_account_id")] + public string? FundingAccountId { get; set; } = default!; + + /// + /// A positive amount of how much will be deposited into ledger (decimal string with two digits of precision e.g. "5.50"). + /// + [JsonPropertyName("amount")] + public string Amount { get; set; } = default!; + + /// + /// The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } = default!; + + /// + /// A unique key provided by the client, per unique ledger deposit. Maximum of 50 characters. + /// The API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger deposit fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single deposit is created. + /// + [JsonPropertyName("idempotency_key")] + public string IdempotencyKey { get; set; } = default!; + + /// + /// + /// + [JsonPropertyName("network")] + public Entity.TransferACHNetwork Network { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferLedgerDepositResponse.cs b/src/Plaid/Transfer/TransferLedgerDepositResponse.cs new file mode 100644 index 00000000..e163ea4e --- /dev/null +++ b/src/Plaid/Transfer/TransferLedgerDepositResponse.cs @@ -0,0 +1,16 @@ +namespace Going.Plaid.Transfer; + +/// +/// Defines the response schema for /transfer/ledger/deposit +/// +public record TransferLedgerDepositResponse : ResponseBase +{ + /// + /// Describes a sweep of funds to / from the sweep account. + /// A sweep is associated with many sweep events (events of type swept or return_swept) which can be retrieved by invoking the /transfer/event/list endpoint with the corresponding sweep_id. + /// swept events occur when the transfer amount is credited or debited from your sweep account, depending on the type of the transfer. return_swept events occur when a transfer is returned and Plaid undoes the credit or debit. + /// The total sum of the swept and return_swept events is equal to the amount of the sweep Plaid creates and matches the amount of the entry on your sweep account ledger. + /// + [JsonPropertyName("sweep")] + public Entity.TransferSweep Sweep { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferLedgerWithdrawRequest.cs b/src/Plaid/Transfer/TransferLedgerWithdrawRequest.cs new file mode 100644 index 00000000..0c9f37e5 --- /dev/null +++ b/src/Plaid/Transfer/TransferLedgerWithdrawRequest.cs @@ -0,0 +1,44 @@ +namespace Going.Plaid.Transfer; + +/// +/// Defines the request schema for /transfer/ledger/withdraw +/// +public partial class TransferLedgerWithdrawRequest : RequestBase +{ + /// + /// Client ID of the customer that owns the Ledger balance. This is so Plaid knows which of your customers to payout or collect funds. Only applicable for Platform customers. Do not include if you’re paying out to yourself. + /// + [JsonPropertyName("originator_client_id")] + public string? OriginatorClientId { get; set; } = default!; + + /// + /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. You can find your list of funding_account_ids in the Accounts page of your Plaid Dashboard, under the "Account ID" column. + /// + [JsonPropertyName("funding_account_id")] + public string? FundingAccountId { get; set; } = default!; + + /// + /// A positive amount of how much will be withdrawn from the ledger balance (decimal string with two digits of precision e.g. "5.50"). + /// + [JsonPropertyName("amount")] + public string Amount { get; set; } = default!; + + /// + /// The description of the deposit that will be passed to the receiving bank (up to 10 characters). Note that banks utilize this field differently, and may or may not show it on the bank statement. + /// + [JsonPropertyName("description")] + public string? Description { get; set; } = default!; + + /// + /// A unique key provided by the client, per unique ledger withdraw. Maximum of 50 characters. + /// The API supports idempotency for safely retrying the request without accidentally performing the same operation twice. For example, if a request to create a ledger withdraw fails due to a network connection error, you can retry the request with the same idempotency key to guarantee that only a single withdraw is created. + /// + [JsonPropertyName("idempotency_key")] + public string IdempotencyKey { get; set; } = default!; + + /// + /// + /// + [JsonPropertyName("network")] + public Entity.TransferNetwork Network { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferLedgerWithdrawResponse.cs b/src/Plaid/Transfer/TransferLedgerWithdrawResponse.cs new file mode 100644 index 00000000..d9329d88 --- /dev/null +++ b/src/Plaid/Transfer/TransferLedgerWithdrawResponse.cs @@ -0,0 +1,16 @@ +namespace Going.Plaid.Transfer; + +/// +/// Defines the response schema for /transfer/ledger/withdraw +/// +public record TransferLedgerWithdrawResponse : ResponseBase +{ + /// + /// Describes a sweep of funds to / from the sweep account. + /// A sweep is associated with many sweep events (events of type swept or return_swept) which can be retrieved by invoking the /transfer/event/list endpoint with the corresponding sweep_id. + /// swept events occur when the transfer amount is credited or debited from your sweep account, depending on the type of the transfer. return_swept events occur when a transfer is returned and Plaid undoes the credit or debit. + /// The total sum of the swept and return_swept events is equal to the amount of the sweep Plaid creates and matches the amount of the entry on your sweep account ledger. + /// + [JsonPropertyName("sweep")] + public Entity.TransferSweep Sweep { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateRequest.cs b/src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateRequest.cs new file mode 100644 index 00000000..71239037 --- /dev/null +++ b/src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateRequest.cs @@ -0,0 +1,19 @@ +namespace Going.Plaid.Transfer; + +/// +/// Defines the request schema for /transfer/originator/funding_account/update +/// +public partial class TransferOriginatorFundingAccountUpdateRequest : RequestBase +{ + /// + /// The Plaid client ID of the transfer originator. + /// + [JsonPropertyName("originator_client_id")] + public string OriginatorClientId { get; set; } = default!; + + /// + /// The originator's funding account, linked with Plaid Link or /transfer/migrate_account. + /// + [JsonPropertyName("funding_account")] + public Entity.TransferFundingAccount FundingAccount { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateResponse.cs b/src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateResponse.cs new file mode 100644 index 00000000..072dcaaf --- /dev/null +++ b/src/Plaid/Transfer/TransferOriginatorFundingAccountUpdateResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.Transfer; + +/// +/// Defines the response schema for /transfer/originator/funding_account/update +/// +public record TransferOriginatorFundingAccountUpdateResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Transfer/TransferRecurringCreateRequest.cs b/src/Plaid/Transfer/TransferRecurringCreateRequest.cs index fafe3dee..5f743216 100644 --- a/src/Plaid/Transfer/TransferRecurringCreateRequest.cs +++ b/src/Plaid/Transfer/TransferRecurringCreateRequest.cs @@ -13,13 +13,13 @@ public partial class TransferRecurringCreateRequest : RequestBase public string IdempotencyKey { get; set; } = default!; /// - /// The Plaid account_id corresponding to the end-user account that will be debited or credited. Required when creating a transfer using an access_token. + /// The Plaid account_id corresponding to the end-user account that will be debited or credited. /// [JsonPropertyName("account_id")] public string AccountId { get; set; } = default!; /// - /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. + /// The id of the funding account to use, available in the Plaid Dashboard. This determines which of your business checking accounts will be credited or debited. Defaults to the account configured during onboarding. You can find your list of funding_account_ids in the Accounts page of your Plaid Dashboard, under the "Account ID" column. /// [JsonPropertyName("funding_account_id")] public string? FundingAccountId { get; set; } = default!; diff --git a/src/Plaid/Transfer/TransferSweepListRequest.cs b/src/Plaid/Transfer/TransferSweepListRequest.cs index f4bc1ff5..0a6df9b6 100644 --- a/src/Plaid/Transfer/TransferSweepListRequest.cs +++ b/src/Plaid/Transfer/TransferSweepListRequest.cs @@ -58,4 +58,10 @@ public partial class TransferSweepListRequest : RequestBase /// [JsonPropertyName("transfer_id")] public string? TransferId { get; set; } = default!; + + /// + /// The trigger of the sweep + /// + [JsonPropertyName("trigger")] + public Entity.SweepTrigger? Trigger { get; set; } = default!; } \ No newline at end of file diff --git a/src/Plaid/User/PlaidClient.cs b/src/Plaid/User/PlaidClient.cs index 462aa90c..c8771363 100644 --- a/src/Plaid/User/PlaidClient.cs +++ b/src/Plaid/User/PlaidClient.cs @@ -11,4 +11,13 @@ public sealed partial class PlaidClient public Task UserCreateAsync(User.UserCreateRequest request) => PostAsync("/user/create", request) .ParseResponseAsync(); + + /// + /// This endpoint is used to update user information associated with an existing user_token. The user_token should be in the response of /user/create call + /// If you call the endpoint with a non-exist user_token, the call will fail with an error message indicating that the user token is not found. + /// + /// + public Task UserUpdateAsync(User.UserUpdateRequest request) => + PostAsync("/user/update", request) + .ParseResponseAsync(); } \ No newline at end of file diff --git a/src/Plaid/User/UserUpdateRequest.cs b/src/Plaid/User/UserUpdateRequest.cs new file mode 100644 index 00000000..794f36a2 --- /dev/null +++ b/src/Plaid/User/UserUpdateRequest.cs @@ -0,0 +1,19 @@ +namespace Going.Plaid.User; + +/// +/// UserUpdateRequest defines the request schema for /user/update +/// +public partial class UserUpdateRequest : RequestBase +{ + /// + /// The user token associated with the User data is being requested for. + /// + [JsonPropertyName("user_token")] + public string UserToken { get; set; } = default!; + + /// + /// ConsumerReportUserIdentity defines the user identity data collected for consumer report purpose. This field is required to be set if you later use the created user for consumer report purpose. + /// + [JsonPropertyName("consumer_report_user_identity")] + public Entity.ConsumerReportUserIdentity? ConsumerReportUserIdentity { get; set; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/User/UserUpdateResponse.cs b/src/Plaid/User/UserUpdateResponse.cs new file mode 100644 index 00000000..7a09935a --- /dev/null +++ b/src/Plaid/User/UserUpdateResponse.cs @@ -0,0 +1,8 @@ +namespace Going.Plaid.User; + +/// +/// UserUpdateResponse defines the response schema for /user/update +/// +public record UserUpdateResponse : ResponseBase +{ +} \ No newline at end of file diff --git a/src/Plaid/Webhook/BankIncomeCompleteWebhook.cs b/src/Plaid/Webhook/BankIncomeCompleteWebhook.cs index 484f75cc..c41a4f92 100644 --- a/src/Plaid/Webhook/BankIncomeCompleteWebhook.cs +++ b/src/Plaid/Webhook/BankIncomeCompleteWebhook.cs @@ -1,13 +1,13 @@ namespace Going.Plaid.Webhook; /// -/// Fired when a refreshed bank income report has finished generating or failed to generate, triggered by calling /cra/bank_income/get. +/// Fired when a bank income report has finished generating or failed to generate, triggered by calling /credit/bank_income/get in CRA enabled client. /// public record BankIncomeCompleteWebhook : WebhookBase { /// [JsonPropertyName("webhook_type")] - public override WebhookType WebhookType => WebhookType.CraIncome; + public override WebhookType WebhookType => WebhookType.Income; /// [JsonPropertyName("webhook_code")] @@ -20,7 +20,7 @@ public record BankIncomeCompleteWebhook : WebhookBase public string UserId { get; init; } = default!; /// - /// The result of the bank income refresh report generation + /// The result of the bank income report generation /// [JsonPropertyName("result")] public Entity.BankIncomeCompleteResult Result { get; init; } = default!; diff --git a/src/Plaid/Webhook/BaseReportsErrorWebhook.cs b/src/Plaid/Webhook/BaseReportsErrorWebhook.cs index bffae93e..939f0769 100644 --- a/src/Plaid/Webhook/BaseReportsErrorWebhook.cs +++ b/src/Plaid/Webhook/BaseReportsErrorWebhook.cs @@ -20,8 +20,8 @@ public record BaseReportsErrorWebhook : WebhookBase public Entity.PlaidError? Error { get; init; } = default!; /// - /// The ID associated with the Asset Report. + /// The user_id corresponding to the User ID the webhook has fired for. /// - [JsonPropertyName("asset_report_id")] - public string? AssetReportId { get; init; } = default!; + [JsonPropertyName("user_id")] + public string UserId { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Webhook/BaseReportsProductReadyWebhook.cs b/src/Plaid/Webhook/BaseReportsProductReadyWebhook.cs index 369eb56e..8ded431f 100644 --- a/src/Plaid/Webhook/BaseReportsProductReadyWebhook.cs +++ b/src/Plaid/Webhook/BaseReportsProductReadyWebhook.cs @@ -17,5 +17,5 @@ public record BaseReportsProductReadyWebhook : WebhookBase /// The user_id corresponding to the User ID the webhook has fired for. /// [JsonPropertyName("user_id")] - public string? UserId { get; init; } = default!; + public string UserId { get; init; } = default!; } \ No newline at end of file diff --git a/src/Plaid/Webhook/CraBankIncomeCompleteWebhook.cs b/src/Plaid/Webhook/CraBankIncomeCompleteWebhook.cs new file mode 100644 index 00000000..172a4473 --- /dev/null +++ b/src/Plaid/Webhook/CraBankIncomeCompleteWebhook.cs @@ -0,0 +1,27 @@ +namespace Going.Plaid.Webhook; + +/// +/// Fired when a bank income report has finished generating or failed to generate, triggered by calling /cra/bank_income/get. +/// +public record CraBankIncomeCompleteWebhook : WebhookBase +{ + /// + [JsonPropertyName("webhook_type")] + public override WebhookType WebhookType => WebhookType.CraIncome; + + /// + [JsonPropertyName("webhook_code")] + public override WebhookCode WebhookCode => WebhookCode.BankIncomeComplete; + + /// + /// The user_id corresponding to the user the webhook has fired for. + /// + [JsonPropertyName("user_id")] + public string UserId { get; init; } = default!; + + /// + /// The result of the bank income report generation + /// + [JsonPropertyName("result")] + public Entity.CraBankIncomeCompleteResult Result { get; init; } = default!; +} \ No newline at end of file diff --git a/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs b/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs index 9d1fefd4..4daec15c 100644 --- a/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs +++ b/src/Plaid/Webhook/IncomeVerificationStatusWebhook.cs @@ -26,8 +26,8 @@ public record IncomeVerificationStatusWebhook : WebhookBase public string? UserId { get; init; } = default!; /// - /// VERIFICATION_STATUS_PROCESSING_COMPLETE: The income verification status processing has completed. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the /credit/payroll_income/get endpoint and check the document metadata to see which documents were successfully parsed. - /// VERIFICATION_STATUS_PROCESSING_FAILED: A failure occurred when attempting to process the verification documentation. + /// VERIFICATION_STATUS_PROCESSING_COMPLETE: The income verification processing has completed. This indicates that the documents have been parsed successfully or that the documents were not parsable. If the user uploaded multiple documents, this webhook will fire when all documents have finished processing. Call the /credit/payroll_income/get endpoint and check the document metadata to see which documents were successfully parsed. + /// VERIFICATION_STATUS_PROCESSING_FAILED: An unexpected internal error occurred when attempting to process the verification documentation. /// VERIFICATION_STATUS_PENDING_APPROVAL: (deprecated) The income verification has been sent to the user for review. /// [JsonPropertyName("verification_status")] diff --git a/src/Plaid/Webhook/ItemLoginRepairedWebhook.cs b/src/Plaid/Webhook/ItemLoginRepairedWebhook.cs index 70915c86..09a7d7a1 100644 --- a/src/Plaid/Webhook/ItemLoginRepairedWebhook.cs +++ b/src/Plaid/Webhook/ItemLoginRepairedWebhook.cs @@ -1,7 +1,7 @@ namespace Going.Plaid.Webhook; /// -/// Fired when an Item login is repaired and the Item no longer needs to go through update mode. This will occur when the user completed the update mode flow for the Item, either in your application or in another Plaid-connected app. If you have messaging that tells the user to complete the update mode flow (such as in-app banners or out-of-band notifications) you should silence this messaging upon receiving the LOGIN_REPAIRED webhook. +/// Fired when an Item has exited the ITEM_LOGIN_REQUIRED state without the user having gone through the update mode flow in your app (this can happen if the user completed the update mode in a different app). If you have messaging that tells the user to complete the update mode flow, you should silence this messaging upon receiving the LOGIN_REPAIRED webhook. /// public record ItemLoginRepairedWebhook : WebhookBase { diff --git a/src/Plaid/Webhook/RecurringTransferSkippedWebhook.cs b/src/Plaid/Webhook/RecurringTransferSkippedWebhook.cs index 9c9f3d4f..84747a5d 100644 --- a/src/Plaid/Webhook/RecurringTransferSkippedWebhook.cs +++ b/src/Plaid/Webhook/RecurringTransferSkippedWebhook.cs @@ -26,7 +26,7 @@ public record RecurringTransferSkippedWebhook : WebhookBase public Entity.TransferAuthorizationDecision AuthorizationDecision { get; init; } = default!; /// - /// A code representing the rationale for approving or declining the proposed transfer. Possible values are: + /// A code representing the rationale for approving or declining the proposed transfer. /// [JsonPropertyName("authorization_decision_rationale_code")] public Entity.TransferAuthorizationDecisionRationaleCode? AuthorizationDecisionRationaleCode { get; init; } = default!; diff --git a/src/Plaid/Webhook/WalletTransactionStatusUpdateWebhook.cs b/src/Plaid/Webhook/WalletTransactionStatusUpdateWebhook.cs index f7b78f0f..5a85a350 100644 --- a/src/Plaid/Webhook/WalletTransactionStatusUpdateWebhook.cs +++ b/src/Plaid/Webhook/WalletTransactionStatusUpdateWebhook.cs @@ -20,7 +20,7 @@ public record WalletTransactionStatusUpdateWebhook : WebhookBase public string TransactionId { get; init; } = default!; /// - /// The payment_id associated with the transaction. This will be present in case of REFUND and PIS_PAY_IN + /// The payment_id associated with the transaction. This will be present in case of REFUND and PIS_PAY_IN. /// [JsonPropertyName("payment_id")] public string? PaymentId { get; init; } = default!;