mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-02 21:07:58 +08:00
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:
@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user