plaid/model/transfer_authorization_decision_rationale.rs
1use serde::{Serialize, Deserialize};
2use super::TransferAuthorizationDecisionRationaleCode;
3///The rationale for Plaid's decision regarding a proposed transfer. It is always set for `declined` decisions, and may or may not be null for `approved` decisions.
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct TransferAuthorizationDecisionRationale {
6 /**A code representing the rationale for approving or declining the proposed transfer.
7
8If the `rationale_code` is `null`, the transfer passed the authorization check.
9
10Any non-`null` value for an `approved` transfer indicates that the the authorization check could not be run and that you should perform your own risk assessment on the transfer. The code will indicate why the check could not be run. Possible values for an `approved` transfer are:
11
12`MANUALLY_VERIFIED_ITEM` – Item created via a manual entry flow (i.e. Same Day Micro-deposit, Instant Micro-deposit, Database Insights, or Database Match), limited information available.
13
14`ITEM_LOGIN_REQUIRED` – Unable to collect the account information due to Item staleness. Can be resolved by using Link and setting [`transfer.authorization_id`](https://plaid.com/docs/api/link/#link-token-create-request-transfer-authorization-id) in the request to `/link/token/create`.
15
16`MIGRATED_ACCOUNT_ITEM` - Item created via `/transfer/migrate_account` endpoint, limited information available.
17
18`ERROR` – Unable to collect the account information due to an unspecified error.
19
20The following codes indicate that the authorization decision was `declined`:
21
22`NSF` – Transaction likely to result in a return due to insufficient funds.
23
24`RISK` - Transaction is high-risk.
25
26`TRANSFER_LIMIT_REACHED` - One or several transfer limits are reached, e.g. monthly transfer limit. Check the accompanying `description` field to understand which limit has been reached.*/
27 pub code: TransferAuthorizationDecisionRationaleCode,
28 ///A human-readable description of the code associated with a transfer approval or transfer decline.
29 pub description: String,
30}
31impl std::fmt::Display for TransferAuthorizationDecisionRationale {
32 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
33 write!(f, "{}", serde_json::to_string(self).unwrap())
34 }
35}