mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-11-01 11:06:50 +08:00
feat(connector): [HELCIM] Move connector to hyperswitch_connectors (#5287)
This commit is contained in:
32
crates/hyperswitch_interfaces/src/api/disputes.rs
Normal file
32
crates/hyperswitch_interfaces/src/api/disputes.rs
Normal file
@ -0,0 +1,32 @@
|
||||
//! Disputes interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_flow_types::dispute::{Accept, Defend, Evidence},
|
||||
router_request_types::{
|
||||
AcceptDisputeRequestData, DefendDisputeRequestData, SubmitEvidenceRequestData,
|
||||
},
|
||||
router_response_types::{AcceptDisputeResponse, DefendDisputeResponse, SubmitEvidenceResponse},
|
||||
};
|
||||
|
||||
use crate::api::ConnectorIntegration;
|
||||
|
||||
/// trait AcceptDispute
|
||||
pub trait AcceptDispute:
|
||||
ConnectorIntegration<Accept, AcceptDisputeRequestData, AcceptDisputeResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait SubmitEvidence
|
||||
pub trait SubmitEvidence:
|
||||
ConnectorIntegration<Evidence, SubmitEvidenceRequestData, SubmitEvidenceResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait DefendDispute
|
||||
pub trait DefendDispute:
|
||||
ConnectorIntegration<Defend, DefendDisputeRequestData, DefendDisputeResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait Dispute
|
||||
pub trait Dispute: super::ConnectorCommon + AcceptDispute + SubmitEvidence + DefendDispute {}
|
||||
40
crates/hyperswitch_interfaces/src/api/disputes_v2.rs
Normal file
40
crates/hyperswitch_interfaces/src/api/disputes_v2.rs
Normal file
@ -0,0 +1,40 @@
|
||||
//! Disputes V2 interface
|
||||
use hyperswitch_domain_models::{
|
||||
router_data_v2::DisputesFlowData,
|
||||
router_flow_types::dispute::{Accept, Defend, Evidence},
|
||||
router_request_types::{
|
||||
AcceptDisputeRequestData, DefendDisputeRequestData, SubmitEvidenceRequestData,
|
||||
},
|
||||
router_response_types::{AcceptDisputeResponse, DefendDisputeResponse, SubmitEvidenceResponse},
|
||||
};
|
||||
|
||||
use crate::api::ConnectorIntegrationV2;
|
||||
|
||||
/// trait AcceptDisputeV2
|
||||
pub trait AcceptDisputeV2:
|
||||
ConnectorIntegrationV2<Accept, DisputesFlowData, AcceptDisputeRequestData, AcceptDisputeResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait SubmitEvidenceV2
|
||||
pub trait SubmitEvidenceV2:
|
||||
ConnectorIntegrationV2<
|
||||
Evidence,
|
||||
DisputesFlowData,
|
||||
SubmitEvidenceRequestData,
|
||||
SubmitEvidenceResponse,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait DefendDisputeV2
|
||||
pub trait DefendDisputeV2:
|
||||
ConnectorIntegrationV2<Defend, DisputesFlowData, DefendDisputeRequestData, DefendDisputeResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait DisputeV2
|
||||
pub trait DisputeV2:
|
||||
super::ConnectorCommon + AcceptDisputeV2 + SubmitEvidenceV2 + DefendDisputeV2
|
||||
{
|
||||
}
|
||||
49
crates/hyperswitch_interfaces/src/api/files.rs
Normal file
49
crates/hyperswitch_interfaces/src/api/files.rs
Normal file
@ -0,0 +1,49 @@
|
||||
//! Files interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_flow_types::files::{Retrieve, Upload},
|
||||
router_request_types::{RetrieveFileRequestData, UploadFileRequestData},
|
||||
router_response_types::{RetrieveFileResponse, UploadFileResponse},
|
||||
};
|
||||
|
||||
use crate::{
|
||||
api::{ConnectorCommon, ConnectorIntegration},
|
||||
errors,
|
||||
};
|
||||
|
||||
/// enum FilePurpose
|
||||
#[derive(Debug, serde::Deserialize, strum::Display, Clone, serde::Serialize)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[strum(serialize_all = "snake_case")]
|
||||
pub enum FilePurpose {
|
||||
/// DisputeEvidence
|
||||
DisputeEvidence,
|
||||
}
|
||||
|
||||
/// trait UploadFile
|
||||
pub trait UploadFile:
|
||||
ConnectorIntegration<Upload, UploadFileRequestData, UploadFileResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait RetrieveFile
|
||||
pub trait RetrieveFile:
|
||||
ConnectorIntegration<Retrieve, RetrieveFileRequestData, RetrieveFileResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FileUpload
|
||||
pub trait FileUpload: ConnectorCommon + Sync + UploadFile + RetrieveFile {
|
||||
/// fn validate_file_upload
|
||||
fn validate_file_upload(
|
||||
&self,
|
||||
_purpose: FilePurpose,
|
||||
_file_size: i32,
|
||||
_file_type: mime::Mime,
|
||||
) -> common_utils::errors::CustomResult<(), errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::FileValidationFailed {
|
||||
reason: "".to_owned(),
|
||||
}
|
||||
.into())
|
||||
}
|
||||
}
|
||||
38
crates/hyperswitch_interfaces/src/api/files_v2.rs
Normal file
38
crates/hyperswitch_interfaces/src/api/files_v2.rs
Normal file
@ -0,0 +1,38 @@
|
||||
//! Files V2 interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_data_v2::FilesFlowData,
|
||||
router_flow_types::{Retrieve, Upload},
|
||||
router_request_types::{RetrieveFileRequestData, UploadFileRequestData},
|
||||
router_response_types::{RetrieveFileResponse, UploadFileResponse},
|
||||
};
|
||||
|
||||
use crate::api::{errors, files::FilePurpose, ConnectorCommon, ConnectorIntegrationV2};
|
||||
|
||||
/// trait UploadFileV2
|
||||
pub trait UploadFileV2:
|
||||
ConnectorIntegrationV2<Upload, FilesFlowData, UploadFileRequestData, UploadFileResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait RetrieveFileV2
|
||||
pub trait RetrieveFileV2:
|
||||
ConnectorIntegrationV2<Retrieve, FilesFlowData, RetrieveFileRequestData, RetrieveFileResponse>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FileUploadV2
|
||||
pub trait FileUploadV2: ConnectorCommon + Sync + UploadFileV2 + RetrieveFileV2 {
|
||||
/// fn validate_file_upload_v2
|
||||
fn validate_file_upload_v2(
|
||||
&self,
|
||||
_purpose: FilePurpose,
|
||||
_file_size: i32,
|
||||
_file_type: mime::Mime,
|
||||
) -> common_utils::errors::CustomResult<(), errors::ConnectorError> {
|
||||
Err(errors::ConnectorError::FileValidationFailed {
|
||||
reason: "".to_owned(),
|
||||
}
|
||||
.into())
|
||||
}
|
||||
}
|
||||
41
crates/hyperswitch_interfaces/src/api/fraud_check.rs
Normal file
41
crates/hyperswitch_interfaces/src/api/fraud_check.rs
Normal file
@ -0,0 +1,41 @@
|
||||
//! FRM interface
|
||||
use hyperswitch_domain_models::{
|
||||
router_flow_types::{Checkout, Fulfillment, RecordReturn, Sale, Transaction},
|
||||
router_request_types::fraud_check::{
|
||||
FraudCheckCheckoutData, FraudCheckFulfillmentData, FraudCheckRecordReturnData,
|
||||
FraudCheckSaleData, FraudCheckTransactionData,
|
||||
},
|
||||
router_response_types::fraud_check::FraudCheckResponseData,
|
||||
};
|
||||
|
||||
use crate::api::ConnectorIntegration;
|
||||
|
||||
/// trait FraudCheckSale
|
||||
pub trait FraudCheckSale:
|
||||
ConnectorIntegration<Sale, FraudCheckSaleData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckCheckout
|
||||
pub trait FraudCheckCheckout:
|
||||
ConnectorIntegration<Checkout, FraudCheckCheckoutData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckTransaction
|
||||
pub trait FraudCheckTransaction:
|
||||
ConnectorIntegration<Transaction, FraudCheckTransactionData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckFulfillment
|
||||
pub trait FraudCheckFulfillment:
|
||||
ConnectorIntegration<Fulfillment, FraudCheckFulfillmentData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckRecordReturn
|
||||
pub trait FraudCheckRecordReturn:
|
||||
ConnectorIntegration<RecordReturn, FraudCheckRecordReturnData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
47
crates/hyperswitch_interfaces/src/api/fraud_check_v2.rs
Normal file
47
crates/hyperswitch_interfaces/src/api/fraud_check_v2.rs
Normal file
@ -0,0 +1,47 @@
|
||||
//! FRM V2 interface
|
||||
use hyperswitch_domain_models::{
|
||||
router_data_v2::flow_common_types::FrmFlowData,
|
||||
router_flow_types::{Checkout, Fulfillment, RecordReturn, Sale, Transaction},
|
||||
router_request_types::fraud_check::{
|
||||
FraudCheckCheckoutData, FraudCheckFulfillmentData, FraudCheckRecordReturnData,
|
||||
FraudCheckSaleData, FraudCheckTransactionData,
|
||||
},
|
||||
router_response_types::fraud_check::FraudCheckResponseData,
|
||||
};
|
||||
|
||||
use crate::api::ConnectorIntegrationV2;
|
||||
|
||||
/// trait FraudCheckSaleV2
|
||||
pub trait FraudCheckSaleV2:
|
||||
ConnectorIntegrationV2<Sale, FrmFlowData, FraudCheckSaleData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckCheckoutV2
|
||||
pub trait FraudCheckCheckoutV2:
|
||||
ConnectorIntegrationV2<Checkout, FrmFlowData, FraudCheckCheckoutData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckTransactionV2
|
||||
pub trait FraudCheckTransactionV2:
|
||||
ConnectorIntegrationV2<Transaction, FrmFlowData, FraudCheckTransactionData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckFulfillmentV2
|
||||
pub trait FraudCheckFulfillmentV2:
|
||||
ConnectorIntegrationV2<Fulfillment, FrmFlowData, FraudCheckFulfillmentData, FraudCheckResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait FraudCheckRecordReturnV2
|
||||
pub trait FraudCheckRecordReturnV2:
|
||||
ConnectorIntegrationV2<
|
||||
RecordReturn,
|
||||
FrmFlowData,
|
||||
FraudCheckRecordReturnData,
|
||||
FraudCheckResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
135
crates/hyperswitch_interfaces/src/api/payments.rs
Normal file
135
crates/hyperswitch_interfaces/src/api/payments.rs
Normal file
@ -0,0 +1,135 @@
|
||||
//! Payments interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_flow_types::payments::{
|
||||
Approve, Authorize, AuthorizeSessionToken, Capture, CompleteAuthorize,
|
||||
CreateConnectorCustomer, IncrementalAuthorization, PSync, PaymentMethodToken,
|
||||
PostProcessing, PreProcessing, Reject, Session, SetupMandate, Void,
|
||||
},
|
||||
router_request_types::{
|
||||
AuthorizeSessionTokenData, CompleteAuthorizeData, ConnectorCustomerData,
|
||||
PaymentMethodTokenizationData, PaymentsApproveData, PaymentsAuthorizeData,
|
||||
PaymentsCancelData, PaymentsCaptureData, PaymentsIncrementalAuthorizationData,
|
||||
PaymentsPostProcessingData, PaymentsPreProcessingData, PaymentsRejectData,
|
||||
PaymentsSessionData, PaymentsSyncData, SetupMandateRequestData,
|
||||
},
|
||||
router_response_types::PaymentsResponseData,
|
||||
};
|
||||
|
||||
use crate::api;
|
||||
|
||||
/// trait Payment
|
||||
pub trait Payment:
|
||||
api::ConnectorCommon
|
||||
+ api::ConnectorValidation
|
||||
+ PaymentAuthorize
|
||||
+ PaymentAuthorizeSessionToken
|
||||
+ PaymentsCompleteAuthorize
|
||||
+ PaymentSync
|
||||
+ PaymentCapture
|
||||
+ PaymentVoid
|
||||
+ PaymentApprove
|
||||
+ PaymentReject
|
||||
+ MandateSetup
|
||||
+ PaymentSession
|
||||
+ PaymentToken
|
||||
+ PaymentsPreProcessing
|
||||
+ PaymentsPostProcessing
|
||||
+ ConnectorCustomer
|
||||
+ PaymentIncrementalAuthorization
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentSession
|
||||
pub trait PaymentSession:
|
||||
api::ConnectorIntegration<Session, PaymentsSessionData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait MandateSetup
|
||||
pub trait MandateSetup:
|
||||
api::ConnectorIntegration<SetupMandate, SetupMandateRequestData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentAuthorize
|
||||
pub trait PaymentAuthorize:
|
||||
api::ConnectorIntegration<Authorize, PaymentsAuthorizeData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentCapture
|
||||
pub trait PaymentCapture:
|
||||
api::ConnectorIntegration<Capture, PaymentsCaptureData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentSync
|
||||
pub trait PaymentSync:
|
||||
api::ConnectorIntegration<PSync, PaymentsSyncData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentVoid
|
||||
pub trait PaymentVoid:
|
||||
api::ConnectorIntegration<Void, PaymentsCancelData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentApprove
|
||||
pub trait PaymentApprove:
|
||||
api::ConnectorIntegration<Approve, PaymentsApproveData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentReject
|
||||
pub trait PaymentReject:
|
||||
api::ConnectorIntegration<Reject, PaymentsRejectData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentToken
|
||||
pub trait PaymentToken:
|
||||
api::ConnectorIntegration<PaymentMethodToken, PaymentMethodTokenizationData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentAuthorizeSessionToken
|
||||
pub trait PaymentAuthorizeSessionToken:
|
||||
api::ConnectorIntegration<AuthorizeSessionToken, AuthorizeSessionTokenData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentIncrementalAuthorization
|
||||
pub trait PaymentIncrementalAuthorization:
|
||||
api::ConnectorIntegration<
|
||||
IncrementalAuthorization,
|
||||
PaymentsIncrementalAuthorizationData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentsCompleteAuthorize
|
||||
pub trait PaymentsCompleteAuthorize:
|
||||
api::ConnectorIntegration<CompleteAuthorize, CompleteAuthorizeData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait ConnectorCustomer
|
||||
pub trait ConnectorCustomer:
|
||||
api::ConnectorIntegration<CreateConnectorCustomer, ConnectorCustomerData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentsPreProcessing
|
||||
pub trait PaymentsPreProcessing:
|
||||
api::ConnectorIntegration<PreProcessing, PaymentsPreProcessingData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentsPostProcessing
|
||||
pub trait PaymentsPostProcessing:
|
||||
api::ConnectorIntegration<PostProcessing, PaymentsPostProcessingData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
167
crates/hyperswitch_interfaces/src/api/payments_v2.rs
Normal file
167
crates/hyperswitch_interfaces/src/api/payments_v2.rs
Normal file
@ -0,0 +1,167 @@
|
||||
//! Payments V2 interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_data_v2::PaymentFlowData,
|
||||
router_flow_types::payments::{
|
||||
Approve, Authorize, AuthorizeSessionToken, Capture, CompleteAuthorize,
|
||||
CreateConnectorCustomer, IncrementalAuthorization, PSync, PaymentMethodToken,
|
||||
PostProcessing, PreProcessing, Reject, Session, SetupMandate, Void,
|
||||
},
|
||||
router_request_types::{
|
||||
AuthorizeSessionTokenData, CompleteAuthorizeData, ConnectorCustomerData,
|
||||
PaymentMethodTokenizationData, PaymentsApproveData, PaymentsAuthorizeData,
|
||||
PaymentsCancelData, PaymentsCaptureData, PaymentsIncrementalAuthorizationData,
|
||||
PaymentsPostProcessingData, PaymentsPreProcessingData, PaymentsRejectData,
|
||||
PaymentsSessionData, PaymentsSyncData, SetupMandateRequestData,
|
||||
},
|
||||
router_response_types::PaymentsResponseData,
|
||||
};
|
||||
|
||||
use crate::api::{ConnectorCommon, ConnectorIntegrationV2, ConnectorValidation};
|
||||
|
||||
/// trait PaymentAuthorizeV2
|
||||
pub trait PaymentAuthorizeV2:
|
||||
ConnectorIntegrationV2<Authorize, PaymentFlowData, PaymentsAuthorizeData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentAuthorizeSessionTokenV2
|
||||
pub trait PaymentAuthorizeSessionTokenV2:
|
||||
ConnectorIntegrationV2<
|
||||
AuthorizeSessionToken,
|
||||
PaymentFlowData,
|
||||
AuthorizeSessionTokenData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentSyncV2
|
||||
pub trait PaymentSyncV2:
|
||||
ConnectorIntegrationV2<PSync, PaymentFlowData, PaymentsSyncData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentVoidV2
|
||||
pub trait PaymentVoidV2:
|
||||
ConnectorIntegrationV2<Void, PaymentFlowData, PaymentsCancelData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentApproveV2
|
||||
pub trait PaymentApproveV2:
|
||||
ConnectorIntegrationV2<Approve, PaymentFlowData, PaymentsApproveData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentRejectV2
|
||||
pub trait PaymentRejectV2:
|
||||
ConnectorIntegrationV2<Reject, PaymentFlowData, PaymentsRejectData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentCaptureV2
|
||||
pub trait PaymentCaptureV2:
|
||||
ConnectorIntegrationV2<Capture, PaymentFlowData, PaymentsCaptureData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentSessionV2
|
||||
pub trait PaymentSessionV2:
|
||||
ConnectorIntegrationV2<Session, PaymentFlowData, PaymentsSessionData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait MandateSetupV2
|
||||
pub trait MandateSetupV2:
|
||||
ConnectorIntegrationV2<SetupMandate, PaymentFlowData, SetupMandateRequestData, PaymentsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentIncrementalAuthorizationV2
|
||||
pub trait PaymentIncrementalAuthorizationV2:
|
||||
ConnectorIntegrationV2<
|
||||
IncrementalAuthorization,
|
||||
PaymentFlowData,
|
||||
PaymentsIncrementalAuthorizationData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentsCompleteAuthorizeV2
|
||||
pub trait PaymentsCompleteAuthorizeV2:
|
||||
ConnectorIntegrationV2<
|
||||
CompleteAuthorize,
|
||||
PaymentFlowData,
|
||||
CompleteAuthorizeData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentTokenV2
|
||||
pub trait PaymentTokenV2:
|
||||
ConnectorIntegrationV2<
|
||||
PaymentMethodToken,
|
||||
PaymentFlowData,
|
||||
PaymentMethodTokenizationData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait ConnectorCustomerV2
|
||||
pub trait ConnectorCustomerV2:
|
||||
ConnectorIntegrationV2<
|
||||
CreateConnectorCustomer,
|
||||
PaymentFlowData,
|
||||
ConnectorCustomerData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentsPreProcessingV2
|
||||
pub trait PaymentsPreProcessingV2:
|
||||
ConnectorIntegrationV2<
|
||||
PreProcessing,
|
||||
PaymentFlowData,
|
||||
PaymentsPreProcessingData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentsPostProcessingV2
|
||||
pub trait PaymentsPostProcessingV2:
|
||||
ConnectorIntegrationV2<
|
||||
PostProcessing,
|
||||
PaymentFlowData,
|
||||
PaymentsPostProcessingData,
|
||||
PaymentsResponseData,
|
||||
>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PaymentV2
|
||||
pub trait PaymentV2:
|
||||
ConnectorCommon
|
||||
+ ConnectorValidation
|
||||
+ PaymentAuthorizeV2
|
||||
+ PaymentAuthorizeSessionTokenV2
|
||||
+ PaymentsCompleteAuthorizeV2
|
||||
+ PaymentSyncV2
|
||||
+ PaymentCaptureV2
|
||||
+ PaymentVoidV2
|
||||
+ PaymentApproveV2
|
||||
+ PaymentRejectV2
|
||||
+ MandateSetupV2
|
||||
+ PaymentSessionV2
|
||||
+ PaymentTokenV2
|
||||
+ PaymentsPreProcessingV2
|
||||
+ PaymentsPostProcessingV2
|
||||
+ ConnectorCustomerV2
|
||||
+ PaymentIncrementalAuthorizationV2
|
||||
{
|
||||
}
|
||||
44
crates/hyperswitch_interfaces/src/api/payouts.rs
Normal file
44
crates/hyperswitch_interfaces/src/api/payouts.rs
Normal file
@ -0,0 +1,44 @@
|
||||
//! 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,
|
||||
};
|
||||
|
||||
use crate::api::ConnectorIntegration;
|
||||
|
||||
/// trait PayoutCancel
|
||||
pub trait PayoutCancel: ConnectorIntegration<PoCancel, PayoutsData, PayoutsResponseData> {}
|
||||
|
||||
/// trait PayoutCreate
|
||||
pub trait PayoutCreate: ConnectorIntegration<PoCreate, PayoutsData, PayoutsResponseData> {}
|
||||
|
||||
/// trait PayoutEligibility
|
||||
pub trait PayoutEligibility:
|
||||
ConnectorIntegration<PoEligibility, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutFulfill
|
||||
pub trait PayoutFulfill: ConnectorIntegration<PoFulfill, PayoutsData, PayoutsResponseData> {}
|
||||
|
||||
/// trait PayoutQuote
|
||||
pub trait PayoutQuote: ConnectorIntegration<PoQuote, PayoutsData, PayoutsResponseData> {}
|
||||
|
||||
/// trait PayoutRecipient
|
||||
pub trait PayoutRecipient:
|
||||
ConnectorIntegration<PoRecipient, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutRecipientAccount
|
||||
pub trait PayoutRecipientAccount:
|
||||
ConnectorIntegration<PoRecipientAccount, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutSync
|
||||
pub trait PayoutSync: ConnectorIntegration<PoSync, PayoutsData, PayoutsResponseData> {}
|
||||
59
crates/hyperswitch_interfaces/src/api/payouts_v2.rs
Normal file
59
crates/hyperswitch_interfaces/src/api/payouts_v2.rs
Normal file
@ -0,0 +1,59 @@
|
||||
//! 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_response_types::PayoutsResponseData,
|
||||
};
|
||||
|
||||
use crate::api::ConnectorIntegrationV2;
|
||||
|
||||
/// trait PayoutCancelV2
|
||||
pub trait PayoutCancelV2:
|
||||
ConnectorIntegrationV2<PoCancel, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutCreateV2
|
||||
pub trait PayoutCreateV2:
|
||||
ConnectorIntegrationV2<PoCreate, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutEligibilityV2
|
||||
pub trait PayoutEligibilityV2:
|
||||
ConnectorIntegrationV2<PoEligibility, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutFulfillV2
|
||||
pub trait PayoutFulfillV2:
|
||||
ConnectorIntegrationV2<PoFulfill, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutQuoteV2
|
||||
pub trait PayoutQuoteV2:
|
||||
ConnectorIntegrationV2<PoQuote, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutRecipientV2
|
||||
pub trait PayoutRecipientV2:
|
||||
ConnectorIntegrationV2<PoRecipient, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutRecipientAccountV2
|
||||
pub trait PayoutRecipientAccountV2:
|
||||
ConnectorIntegrationV2<PoRecipientAccount, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait PayoutSyncV2
|
||||
pub trait PayoutSyncV2:
|
||||
ConnectorIntegrationV2<PoSync, PayoutFlowData, PayoutsData, PayoutsResponseData>
|
||||
{
|
||||
}
|
||||
21
crates/hyperswitch_interfaces/src/api/refunds.rs
Normal file
21
crates/hyperswitch_interfaces/src/api/refunds.rs
Normal file
@ -0,0 +1,21 @@
|
||||
//! Refunds interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_flow_types::{Execute, RSync},
|
||||
router_request_types::RefundsData,
|
||||
router_response_types::RefundsResponseData,
|
||||
};
|
||||
|
||||
use crate::api::{self, ConnectorCommon};
|
||||
|
||||
/// trait RefundExecute
|
||||
pub trait RefundExecute:
|
||||
api::ConnectorIntegration<Execute, RefundsData, RefundsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait RefundSync
|
||||
pub trait RefundSync: api::ConnectorIntegration<RSync, RefundsData, RefundsResponseData> {}
|
||||
|
||||
/// trait Refund
|
||||
pub trait Refund: ConnectorCommon + RefundExecute + RefundSync {}
|
||||
25
crates/hyperswitch_interfaces/src/api/refunds_v2.rs
Normal file
25
crates/hyperswitch_interfaces/src/api/refunds_v2.rs
Normal file
@ -0,0 +1,25 @@
|
||||
//! Refunds V2 interface
|
||||
|
||||
use hyperswitch_domain_models::{
|
||||
router_data_v2::flow_common_types::RefundFlowData,
|
||||
router_flow_types::refunds::{Execute, RSync},
|
||||
router_request_types::RefundsData,
|
||||
router_response_types::RefundsResponseData,
|
||||
};
|
||||
|
||||
use crate::api::{ConnectorCommon, ConnectorIntegrationV2};
|
||||
|
||||
/// trait RefundExecuteV2
|
||||
pub trait RefundExecuteV2:
|
||||
ConnectorIntegrationV2<Execute, RefundFlowData, RefundsData, RefundsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait RefundSyncV2
|
||||
pub trait RefundSyncV2:
|
||||
ConnectorIntegrationV2<RSync, RefundFlowData, RefundsData, RefundsResponseData>
|
||||
{
|
||||
}
|
||||
|
||||
/// trait RefundV2
|
||||
pub trait RefundV2: ConnectorCommon + RefundExecuteV2 + RefundSyncV2 {}
|
||||
Reference in New Issue
Block a user