mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-30 17:47:54 +08:00
feat(connector): add payouts integration for AdyenPlatform (#4874)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -44,6 +44,7 @@ pub enum RoutingAlgorithm {
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum Connector {
|
||||
Adyenplatform,
|
||||
#[cfg(feature = "dummy_connector")]
|
||||
#[serde(rename = "phonypay")]
|
||||
#[strum(serialize = "phonypay")]
|
||||
@ -142,7 +143,7 @@ impl Connector {
|
||||
pub fn supports_instant_payout(&self, payout_method: PayoutType) -> bool {
|
||||
matches!(
|
||||
(self, payout_method),
|
||||
(Self::Paypal, PayoutType::Wallet) | (_, PayoutType::Card)
|
||||
(Self::Paypal, PayoutType::Wallet) | (_, PayoutType::Card) | (Self::Adyenplatform, _)
|
||||
)
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
@ -191,6 +192,7 @@ impl Connector {
|
||||
| Self::DummyConnector7 => false,
|
||||
Self::Aci
|
||||
| Self::Adyen
|
||||
| Self::Adyenplatform
|
||||
| Self::Airwallex
|
||||
| Self::Authorizedotnet
|
||||
| Self::Bambora
|
||||
@ -302,11 +304,12 @@ impl AuthenticationConnectors {
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum PayoutConnectors {
|
||||
Adyen,
|
||||
Stripe,
|
||||
Adyenplatform,
|
||||
Cybersource,
|
||||
Ebanx,
|
||||
Payone,
|
||||
Paypal,
|
||||
Ebanx,
|
||||
Cybersource,
|
||||
Stripe,
|
||||
Wise,
|
||||
}
|
||||
|
||||
@ -315,11 +318,12 @@ impl From<PayoutConnectors> for RoutableConnectors {
|
||||
fn from(value: PayoutConnectors) -> Self {
|
||||
match value {
|
||||
PayoutConnectors::Adyen => Self::Adyen,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Adyenplatform => Self::Adyenplatform,
|
||||
PayoutConnectors::Cybersource => Self::Cybersource,
|
||||
PayoutConnectors::Ebanx => Self::Ebanx,
|
||||
PayoutConnectors::Payone => Self::Payone,
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
PayoutConnectors::Ebanx => Self::Ebanx,
|
||||
PayoutConnectors::Cybersource => Self::Cybersource,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
}
|
||||
}
|
||||
@ -330,11 +334,12 @@ impl From<PayoutConnectors> for Connector {
|
||||
fn from(value: PayoutConnectors) -> Self {
|
||||
match value {
|
||||
PayoutConnectors::Adyen => Self::Adyen,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Adyenplatform => Self::Adyenplatform,
|
||||
PayoutConnectors::Cybersource => Self::Cybersource,
|
||||
PayoutConnectors::Ebanx => Self::Ebanx,
|
||||
PayoutConnectors::Payone => Self::Payone,
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
PayoutConnectors::Ebanx => Self::Ebanx,
|
||||
PayoutConnectors::Cybersource => Self::Cybersource,
|
||||
PayoutConnectors::Stripe => Self::Stripe,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
}
|
||||
}
|
||||
@ -346,12 +351,13 @@ impl TryFrom<Connector> for PayoutConnectors {
|
||||
fn try_from(value: Connector) -> Result<Self, Self::Error> {
|
||||
match value {
|
||||
Connector::Adyen => Ok(Self::Adyen),
|
||||
Connector::Adyenplatform => Ok(Self::Adyenplatform),
|
||||
Connector::Cybersource => Ok(Self::Cybersource),
|
||||
Connector::Ebanx => Ok(Self::Ebanx),
|
||||
Connector::Payone => Ok(Self::Payone),
|
||||
Connector::Paypal => Ok(Self::Paypal),
|
||||
Connector::Stripe => Ok(Self::Stripe),
|
||||
Connector::Wise => Ok(Self::Wise),
|
||||
Connector::Paypal => Ok(Self::Paypal),
|
||||
Connector::Ebanx => Ok(Self::Ebanx),
|
||||
Connector::Cybersource => Ok(Self::Cybersource),
|
||||
Connector::Payone => Ok(Self::Payone),
|
||||
_ => Err(format!("Invalid payout connector {}", value)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user