use serde::{Deserialize, Serialize};
use super::bank_account_id::BankAccountId;
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
pub struct BankTransferPaymentMethodConfig {
#[serde(skip_serializing_if = "Option::is_none")]
pub account_id: Option<BankAccountId>,
pub r#type: String,
#[serde(flatten)]
pub extra: serde_json::Map<String, serde_json::Value>,
}
impl BankTransferPaymentMethodConfig {
#[must_use]
pub fn new() -> Self {
Self {
account_id: None,
r#type: "bank_transfer".into(),
extra: serde_json::Map::new(),
}
}
#[must_use]
pub fn account_id(mut self, account_id: impl Into<BankAccountId>) -> Self {
self.account_id = Some(account_id.into());
self
}
}
impl Default for BankTransferPaymentMethodConfig {
fn default() -> Self {
Self {
account_id: Default::default(),
r#type: "bank_transfer".into(),
extra: serde_json::Map::new(),
}
}
}