feat(mca): Added recipient connector call for open banking connectors (#3758)

Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
Sarthak Soni
2024-07-16 13:42:03 +05:30
committed by GitHub
parent e0b6cbb229
commit 3951ac6578
30 changed files with 1052 additions and 27 deletions

View File

@ -652,6 +652,49 @@ pub struct MerchantConnectorCreate {
#[schema(value_type = Option<ConnectorStatus>, example = "inactive")]
pub status: Option<api_enums::ConnectorStatus>,
/// In case the merchant needs to store any additional sensitive data
#[schema(value_type = Option<AdditionalMerchantData>)]
pub additional_merchant_data: Option<AdditionalMerchantData>,
}
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum AdditionalMerchantData {
OpenBankingRecipientData(MerchantRecipientData),
}
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum MerchantAccountData {
Iban {
#[schema(value_type= String)]
iban: Secret<String>,
name: String,
#[schema(value_type= Option<String>)]
#[serde(skip_serializing_if = "Option::is_none")]
connector_recipient_id: Option<Secret<String>>,
},
Bacs {
#[schema(value_type= String)]
account_number: Secret<String>,
#[schema(value_type= String)]
sort_code: Secret<String>,
name: String,
#[schema(value_type= Option<String>)]
#[serde(skip_serializing_if = "Option::is_none")]
connector_recipient_id: Option<Secret<String>>,
},
}
#[derive(Debug, Clone, serde::Deserialize, serde::Serialize, ToSchema)]
#[serde(rename_all = "snake_case")]
pub enum MerchantRecipientData {
#[schema(value_type= Option<String>)]
ConnectorRecipientId(Secret<String>),
#[schema(value_type= Option<String>)]
WalletId(Secret<String>),
AccountData(MerchantAccountData),
}
// Different patterns of authentication.
@ -805,6 +848,9 @@ pub struct MerchantConnectorResponse {
#[schema(value_type = ConnectorStatus, example = "inactive")]
pub status: api_enums::ConnectorStatus,
#[schema(value_type = Option<AdditionalMerchantData>)]
pub additional_merchant_data: Option<AdditionalMerchantData>,
}
/// Create a new Merchant Connector for the merchant account. The connector could be a payment processor / facilitator / acquirer or specialized services like Fraud / Accounting etc."