mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-29 09:07:09 +08:00
feat(payouts): make payout_type optional in payouts table (#4954)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -140,26 +140,28 @@ pub enum Connector {
|
||||
|
||||
impl Connector {
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_instant_payout(&self, payout_method: PayoutType) -> bool {
|
||||
pub fn supports_instant_payout(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!(
|
||||
(self, payout_method),
|
||||
(Self::Paypal, PayoutType::Wallet) | (_, PayoutType::Card) | (Self::Adyenplatform, _)
|
||||
(Self::Paypal, Some(PayoutType::Wallet))
|
||||
| (_, Some(PayoutType::Card))
|
||||
| (Self::Adyenplatform, _)
|
||||
)
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_create_recipient(&self, payout_method: PayoutType) -> bool {
|
||||
matches!((self, payout_method), (_, PayoutType::Bank))
|
||||
pub fn supports_create_recipient(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!((self, payout_method), (_, Some(PayoutType::Bank)))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_payout_eligibility(&self, payout_method: PayoutType) -> bool {
|
||||
matches!((self, payout_method), (_, PayoutType::Card))
|
||||
pub fn supports_payout_eligibility(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!((self, payout_method), (_, Some(PayoutType::Card)))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn is_payout_quote_call_required(&self) -> bool {
|
||||
matches!(self, Self::Wise)
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
pub fn supports_access_token_for_payout(&self, payout_method: PayoutType) -> bool {
|
||||
pub fn supports_access_token_for_payout(&self, payout_method: Option<PayoutType>) -> bool {
|
||||
matches!((self, payout_method), (Self::Paypal, _))
|
||||
}
|
||||
#[cfg(feature = "payouts")]
|
||||
|
||||
Reference in New Issue
Block a user