mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-28 12:15:40 +08:00
feat(core): [Payouts] Add access_token flow for Payout Create and Fulfill flow (#4375)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -135,6 +135,25 @@ pub enum Connector {
|
||||
}
|
||||
|
||||
impl Connector {
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_instant_payout(&self, payout_method: PayoutType) -> bool {
|
||||
matches!(
|
||||
(self, payout_method),
|
||||
(Self::Paypal, PayoutType::Wallet) | (_, PayoutType::Card)
|
||||
)
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_create_recipient(&self, payout_method: PayoutType) -> bool {
|
||||
matches!((self, payout_method), (_, PayoutType::Bank))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_payout_eligibility(&self, payout_method: PayoutType) -> bool {
|
||||
matches!((self, payout_method), (_, PayoutType::Card))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_access_token_for_payout(&self, payout_method: PayoutType) -> bool {
|
||||
matches!((self, payout_method), (Self::Paypal, _))
|
||||
}
|
||||
pub fn supports_access_token(&self, payment_method: PaymentMethod) -> bool {
|
||||
matches!(
|
||||
(self, payment_method),
|
||||
@ -320,6 +339,7 @@ pub enum AuthenticationConnectors {
|
||||
pub enum PayoutConnectors {
|
||||
Adyen,
|
||||
Wise,
|
||||
Paypal,
|
||||
}
|
||||
|
||||
#[cfg(feature = "payouts")]
|
||||
@ -328,6 +348,7 @@ impl From<PayoutConnectors> for RoutableConnectors {
|
||||
match value {
|
||||
PayoutConnectors::Adyen => Self::Adyen,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -338,6 +359,7 @@ impl From<PayoutConnectors> for Connector {
|
||||
match value {
|
||||
PayoutConnectors::Adyen => Self::Adyen,
|
||||
PayoutConnectors::Wise => Self::Wise,
|
||||
PayoutConnectors::Paypal => Self::Paypal,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -349,6 +371,7 @@ impl TryFrom<Connector> for PayoutConnectors {
|
||||
match value {
|
||||
Connector::Adyen => Ok(Self::Adyen),
|
||||
Connector::Wise => Ok(Self::Wise),
|
||||
Connector::Paypal => Ok(Self::Paypal),
|
||||
_ => Err(format!("Invalid payout connector {}", value)),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user