plaid/model/
wallet_transaction_counterparty.rs

1use serde::{Serialize, Deserialize};
2use super::{PaymentInitiationAddress, WalletTransactionCounterpartyNumbers};
3///An object representing the e-wallet transaction's counterparty
4#[derive(Debug, Clone, Serialize, Deserialize, Default)]
5pub struct WalletTransactionCounterparty {
6    ///The optional address of the payment recipient's bank account. Required by most institutions outside of the UK.
7    #[serde(default, skip_serializing_if = "Option::is_none")]
8    pub address: Option<PaymentInitiationAddress>,
9    ///The counterparty's birthdate, in [ISO 8601](https://wikipedia.org/wiki/ISO_8601) (YYYY-MM-DD) format.
10    #[serde(default, skip_serializing_if = "Option::is_none")]
11    pub date_of_birth: Option<chrono::NaiveDate>,
12    ///The name of the counterparty
13    pub name: String,
14    ///The counterparty's bank account numbers. Exactly one of IBAN or BACS data is required.
15    pub numbers: WalletTransactionCounterpartyNumbers,
16}
17impl std::fmt::Display for WalletTransactionCounterparty {
18    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
19        write!(f, "{}", serde_json::to_string(self).unwrap())
20    }
21}