mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 19:42:27 +08:00
refactor: move Payout traits to hyperswitch_interfaces for connectors crate (#6481)
Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
@ -1,13 +1,15 @@
|
||||
//! Payouts interface
|
||||
|
||||
use hyperswitch_domain_models::router_flow_types::payouts::{
|
||||
PoCancel, PoCreate, PoEligibility, PoFulfill, PoQuote, PoRecipient, PoRecipientAccount, PoSync,
|
||||
};
|
||||
#[cfg(feature = "payouts")]
|
||||
use hyperswitch_domain_models::{
|
||||
router_request_types::PayoutsData, router_response_types::PayoutsResponseData,
|
||||
router_flow_types::payouts::{
|
||||
PoCancel, PoCreate, PoEligibility, PoFulfill, PoQuote, PoRecipient, PoRecipientAccount,
|
||||
PoSync,
|
||||
},
|
||||
router_request_types::PayoutsData,
|
||||
router_response_types::PayoutsResponseData,
|
||||
};
|
||||
|
||||
use super::ConnectorCommon;
|
||||
use crate::api::ConnectorIntegration;
|
||||
|
||||
/// trait PayoutCancel
|
||||
@ -42,3 +44,17 @@ pub trait PayoutRecipientAccount:
|
||||
|
||||
/// trait PayoutSync
|
||||
pub trait PayoutSync: ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> {}
|
||||
|
||||
/// trait Payouts
|
||||
pub trait Payouts:
|
||||
ConnectorCommon
|
||||
+ PayoutCancel
|
||||
+ PayoutCreate
|
||||
+ PayoutEligibility
|
||||
+ PayoutFulfill
|
||||
+ PayoutQuote
|
||||
+ PayoutRecipient
|
||||
+ PayoutRecipientAccount
|
||||
+ PayoutSync
|
||||
{
|
||||
}
|
||||
|
||||
@ -1,13 +1,15 @@
|
||||
//! Payouts V2 interface
|
||||
use hyperswitch_domain_models::router_flow_types::payouts::{
|
||||
PoCancel, PoCreate, PoEligibility, PoFulfill, PoQuote, PoRecipient, PoRecipientAccount, PoSync,
|
||||
};
|
||||
#[cfg(feature = "payouts")]
|
||||
use hyperswitch_domain_models::{
|
||||
router_data_v2::flow_common_types::PayoutFlowData, router_request_types::PayoutsData,
|
||||
router_data_v2::flow_common_types::PayoutFlowData,
|
||||
router_flow_types::payouts::{
|
||||
PoCancel, PoCreate, PoEligibility, PoFulfill, PoQuote, PoRecipient, PoRecipientAccount,
|
||||
PoSync,
|
||||
},
|
||||
router_request_types::PayoutsData,
|
||||
router_response_types::PayoutsResponseData,
|
||||
};
|
||||
|
||||
use super::ConnectorCommon;
|
||||
use crate::api::ConnectorIntegrationV2;
|
||||
|
||||
/// trait PayoutCancelV2
|
||||
@ -57,3 +59,21 @@ pub trait PayoutSyncV2:
|
||||
ConnectorIntegrationV2<PoSync, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait Payouts
|
||||
pub trait PayoutsV2:
|
||||
ConnectorCommon
|
||||
+ PayoutCancelV2
|
||||
+ PayoutCreateV2
|
||||
+ PayoutEligibilityV2
|
||||
+ PayoutFulfillV2
|
||||
+ PayoutQuoteV2
|
||||
+ PayoutRecipientV2
|
||||
+ PayoutRecipientAccountV2
|
||||
+ PayoutSyncV2
|
||||
{
|
||||
}
|
||||
|
||||
/// Empty trait for when payouts feature is disabled
|
||||
#[cfg(not(feature = "payouts"))]
|
||||
pub trait PayoutsV2 {}
|
||||
|
||||
Reference in New Issue
Block a user