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

@ -2,6 +2,36 @@ use pm_auth::types::{self as pm_auth_types};
use crate::{core::errors, types, types::transformers::ForeignTryFrom};
impl From<types::MerchantAccountData> for pm_auth_types::MerchantAccountData {
fn from(from: types::MerchantAccountData) -> Self {
match from {
types::MerchantAccountData::Iban { iban, name, .. } => Self::Iban { iban, name },
types::MerchantAccountData::Bacs {
account_number,
sort_code,
name,
..
} => Self::Bacs {
account_number,
sort_code,
name,
},
}
}
}
impl From<types::MerchantRecipientData> for pm_auth_types::MerchantRecipientData {
fn from(value: types::MerchantRecipientData) -> Self {
match value {
types::MerchantRecipientData::ConnectorRecipientId(id) => {
Self::ConnectorRecipientId(id)
}
types::MerchantRecipientData::WalletId(id) => Self::WalletId(id),
types::MerchantRecipientData::AccountData(data) => Self::AccountData(data.into()),
}
}
}
impl ForeignTryFrom<types::ConnectorAuthType> for pm_auth_types::ConnectorAuthType {
type Error = errors::ConnectorError;
fn foreign_try_from(auth_type: types::ConnectorAuthType) -> Result<Self, Self::Error> {