mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(connector): [Loonio] implement payouts (#9718)
This commit is contained in:
@ -49,6 +49,7 @@ pub enum PayoutConnectors {
|
||||
Cybersource,
|
||||
Ebanx,
|
||||
Gigadat,
|
||||
Loonio,
|
||||
Nomupay,
|
||||
Nuvei,
|
||||
Payone,
|
||||
@ -77,6 +78,7 @@ impl From<PayoutConnectors> for RoutableConnectors {
|
||||
PayoutConnectors::Cybersource => Self::Cybersource,
|
||||
PayoutConnectors::Ebanx => Self::Ebanx,
|
||||
PayoutConnectors::Gigadat => Self::Gigadat,
|
||||
PayoutConnectors::Loonio => Self::Loonio,
|
||||
PayoutConnectors::Nomupay => Self::Nomupay,
|
||||
PayoutConnectors::Nuvei => Self::Nuvei,
|
||||
PayoutConnectors::Payone => Self::Payone,
|
||||
@ -96,6 +98,7 @@ impl From<PayoutConnectors> for Connector {
|
||||
PayoutConnectors::Cybersource => Self::Cybersource,
|
||||
PayoutConnectors::Ebanx => Self::Ebanx,
|
||||
PayoutConnectors::Gigadat => Self::Gigadat,
|
||||
PayoutConnectors::Loonio => Self::Loonio,
|
||||
PayoutConnectors::Nomupay => Self::Nomupay,
|
||||
PayoutConnectors::Nuvei => Self::Nuvei,
|
||||
PayoutConnectors::Payone => Self::Payone,
|
||||
@ -115,6 +118,7 @@ impl TryFrom<Connector> for PayoutConnectors {
|
||||
Connector::Adyenplatform => Ok(Self::Adyenplatform),
|
||||
Connector::Cybersource => Ok(Self::Cybersource),
|
||||
Connector::Ebanx => Ok(Self::Ebanx),
|
||||
Connector::Loonio => Ok(Self::Loonio),
|
||||
Connector::Nuvei => Ok(Self::Nuvei),
|
||||
Connector::Nomupay => Ok(Self::Nomupay),
|
||||
Connector::Payone => Ok(Self::Payone),
|
||||
|
||||
@ -242,6 +242,7 @@ pub enum PayoutMethodData {
|
||||
Card(CardPayout),
|
||||
Bank(Bank),
|
||||
Wallet(Wallet),
|
||||
BankRedirect(BankRedirect),
|
||||
}
|
||||
|
||||
impl Default for PayoutMethodData {
|
||||
@ -378,6 +379,19 @@ pub enum Wallet {
|
||||
Venmo(Venmo),
|
||||
}
|
||||
|
||||
#[derive(Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum BankRedirect {
|
||||
Interac(Interac),
|
||||
}
|
||||
|
||||
#[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)]
|
||||
pub struct Interac {
|
||||
/// Customer email linked with interac account
|
||||
#[schema(value_type = String, example = "john.doe@example.com")]
|
||||
pub email: Email,
|
||||
}
|
||||
|
||||
#[derive(Default, Eq, PartialEq, Clone, Debug, Deserialize, Serialize, ToSchema)]
|
||||
pub struct Paypal {
|
||||
/// Email linked with paypal account
|
||||
@ -602,6 +616,8 @@ pub enum PayoutMethodDataResponse {
|
||||
Bank(Box<payout_method_utils::BankAdditionalData>),
|
||||
#[schema(value_type = WalletAdditionalData)]
|
||||
Wallet(Box<payout_method_utils::WalletAdditionalData>),
|
||||
#[schema(value_type = BankRedirectAdditionalData)]
|
||||
BankRedirect(Box<payout_method_utils::BankRedirectAdditionalData>),
|
||||
}
|
||||
|
||||
#[derive(
|
||||
@ -988,6 +1004,18 @@ impl From<Wallet> for payout_method_utils::WalletAdditionalData {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<BankRedirect> for payout_method_utils::BankRedirectAdditionalData {
|
||||
fn from(bank_redirect: BankRedirect) -> Self {
|
||||
match bank_redirect {
|
||||
BankRedirect::Interac(Interac { email }) => {
|
||||
Self::Interac(Box::new(payout_method_utils::InteracAdditionalData {
|
||||
email: Some(ForeignFrom::foreign_from(email)),
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<payout_method_utils::AdditionalPayoutMethodData> for PayoutMethodDataResponse {
|
||||
fn from(additional_data: payout_method_utils::AdditionalPayoutMethodData) -> Self {
|
||||
match additional_data {
|
||||
@ -1000,6 +1028,9 @@ impl From<payout_method_utils::AdditionalPayoutMethodData> for PayoutMethodDataR
|
||||
payout_method_utils::AdditionalPayoutMethodData::Wallet(wallet_data) => {
|
||||
Self::Wallet(wallet_data)
|
||||
}
|
||||
payout_method_utils::AdditionalPayoutMethodData::BankRedirect(bank_redirect) => {
|
||||
Self::BankRedirect(bank_redirect)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user