mirror of
https://github.com/juspay/hyperswitch.git
synced 2025-10-27 19:46:48 +08:00
feat(core): Adds Billing Connector Invoice Sync flow in Revenue Recovery (#7799)
Co-authored-by: Nishanth Challa <nishanth.challa@Nishanth-Challa-C0WGKCFHLF.local> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
600137275f
commit
3d0dd5bd1a
@ -4520,3 +4520,109 @@ default_imp_for_revenue_recovery_record_back!(
|
|||||||
connectors::Zen,
|
connectors::Zen,
|
||||||
connectors::Zsl
|
connectors::Zsl
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
|
macro_rules! default_imp_for_billing_connector_invoice_sync {
|
||||||
|
($($path:ident::$connector:ident),*) => {
|
||||||
|
$( impl recovery_traits::BillingConnectorInvoiceSyncIntegration for $path::$connector {}
|
||||||
|
impl
|
||||||
|
ConnectorIntegration<
|
||||||
|
recovery_router_flows::BillingConnectorInvoiceSync,
|
||||||
|
recovery_request::BillingConnectorInvoiceSyncRequest,
|
||||||
|
recovery_response::BillingConnectorInvoiceSyncResponse
|
||||||
|
> for $path::$connector
|
||||||
|
{}
|
||||||
|
)*
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
|
default_imp_for_billing_connector_invoice_sync!(
|
||||||
|
connectors::Aci,
|
||||||
|
connectors::Adyen,
|
||||||
|
connectors::Airwallex,
|
||||||
|
connectors::Amazonpay,
|
||||||
|
connectors::Authorizedotnet,
|
||||||
|
connectors::Bambora,
|
||||||
|
connectors::Bamboraapac,
|
||||||
|
connectors::Bankofamerica,
|
||||||
|
connectors::Billwerk,
|
||||||
|
connectors::Bluesnap,
|
||||||
|
connectors::Bitpay,
|
||||||
|
connectors::Braintree,
|
||||||
|
connectors::Boku,
|
||||||
|
connectors::Cashtocode,
|
||||||
|
connectors::Chargebee,
|
||||||
|
connectors::Checkout,
|
||||||
|
connectors::Coinbase,
|
||||||
|
connectors::Coingate,
|
||||||
|
connectors::Cryptopay,
|
||||||
|
connectors::CtpMastercard,
|
||||||
|
connectors::Cybersource,
|
||||||
|
connectors::Datatrans,
|
||||||
|
connectors::Deutschebank,
|
||||||
|
connectors::Digitalvirgo,
|
||||||
|
connectors::Dlocal,
|
||||||
|
connectors::Elavon,
|
||||||
|
connectors::Facilitapay,
|
||||||
|
connectors::Fiserv,
|
||||||
|
connectors::Fiservemea,
|
||||||
|
connectors::Fiuu,
|
||||||
|
connectors::Forte,
|
||||||
|
connectors::Getnet,
|
||||||
|
connectors::Globalpay,
|
||||||
|
connectors::Globepay,
|
||||||
|
connectors::Gocardless,
|
||||||
|
connectors::Helcim,
|
||||||
|
connectors::Hipay,
|
||||||
|
connectors::Iatapay,
|
||||||
|
connectors::Inespay,
|
||||||
|
connectors::Itaubank,
|
||||||
|
connectors::Juspaythreedsserver,
|
||||||
|
connectors::Jpmorgan,
|
||||||
|
connectors::Klarna,
|
||||||
|
connectors::Nomupay,
|
||||||
|
connectors::Nmi,
|
||||||
|
connectors::Noon,
|
||||||
|
connectors::Novalnet,
|
||||||
|
connectors::Nexinets,
|
||||||
|
connectors::Nexixpay,
|
||||||
|
connectors::Nuvei,
|
||||||
|
connectors::Opayo,
|
||||||
|
connectors::Opennode,
|
||||||
|
connectors::Payeezy,
|
||||||
|
connectors::Paystack,
|
||||||
|
connectors::Payu,
|
||||||
|
connectors::Paypal,
|
||||||
|
connectors::Powertranz,
|
||||||
|
connectors::Prophetpay,
|
||||||
|
connectors::Mifinity,
|
||||||
|
connectors::Mollie,
|
||||||
|
connectors::Moneris,
|
||||||
|
connectors::Multisafepay,
|
||||||
|
connectors::Paybox,
|
||||||
|
connectors::Payme,
|
||||||
|
connectors::Payone,
|
||||||
|
connectors::Placetopay,
|
||||||
|
connectors::Rapyd,
|
||||||
|
connectors::Razorpay,
|
||||||
|
connectors::Recurly,
|
||||||
|
connectors::Redsys,
|
||||||
|
connectors::Riskified,
|
||||||
|
connectors::Shift4,
|
||||||
|
connectors::Stax,
|
||||||
|
connectors::Square,
|
||||||
|
connectors::Stripebilling,
|
||||||
|
connectors::Taxjar,
|
||||||
|
connectors::Thunes,
|
||||||
|
connectors::Trustpay,
|
||||||
|
connectors::Tsys,
|
||||||
|
connectors::UnifiedAuthenticationService,
|
||||||
|
connectors::Worldline,
|
||||||
|
connectors::Worldpay,
|
||||||
|
connectors::Wellsfargo,
|
||||||
|
connectors::Volt,
|
||||||
|
connectors::Xendit,
|
||||||
|
connectors::Zen,
|
||||||
|
connectors::Zsl
|
||||||
|
);
|
||||||
|
|||||||
@ -2,9 +2,9 @@ use hyperswitch_domain_models::{
|
|||||||
router_data::AccessToken,
|
router_data::AccessToken,
|
||||||
router_data_v2::{
|
router_data_v2::{
|
||||||
flow_common_types::{
|
flow_common_types::{
|
||||||
BillingConnectorPaymentsSyncFlowData, DisputesFlowData, MandateRevokeFlowData,
|
BillingConnectorInvoiceSyncFlowData, BillingConnectorPaymentsSyncFlowData,
|
||||||
PaymentFlowData, RefundFlowData, RevenueRecoveryRecordBackData,
|
DisputesFlowData, MandateRevokeFlowData, PaymentFlowData, RefundFlowData,
|
||||||
WebhookSourceVerifyData,
|
RevenueRecoveryRecordBackData, WebhookSourceVerifyData,
|
||||||
},
|
},
|
||||||
AccessTokenFlowData, ExternalAuthenticationFlowData, FilesFlowData,
|
AccessTokenFlowData, ExternalAuthenticationFlowData, FilesFlowData,
|
||||||
},
|
},
|
||||||
@ -22,13 +22,18 @@ use hyperswitch_domain_models::{
|
|||||||
SetupMandate, UpdateMetadata, Void,
|
SetupMandate, UpdateMetadata, Void,
|
||||||
},
|
},
|
||||||
refunds::{Execute, RSync},
|
refunds::{Execute, RSync},
|
||||||
revenue_recovery::{BillingConnectorPaymentsSync, RecoveryRecordBack},
|
revenue_recovery::{
|
||||||
|
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
|
||||||
|
},
|
||||||
webhooks::VerifyWebhookSource,
|
webhooks::VerifyWebhookSource,
|
||||||
AccessTokenAuth,
|
AccessTokenAuth,
|
||||||
},
|
},
|
||||||
router_request_types::{
|
router_request_types::{
|
||||||
authentication,
|
authentication,
|
||||||
revenue_recovery::{BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest},
|
revenue_recovery::{
|
||||||
|
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
|
||||||
|
RevenueRecoveryRecordBackRequest,
|
||||||
|
},
|
||||||
AcceptDisputeRequestData, AccessTokenRequestData, AuthorizeSessionTokenData,
|
AcceptDisputeRequestData, AccessTokenRequestData, AuthorizeSessionTokenData,
|
||||||
CompleteAuthorizeData, ConnectorCustomerData, DefendDisputeRequestData,
|
CompleteAuthorizeData, ConnectorCustomerData, DefendDisputeRequestData,
|
||||||
MandateRevokeRequestData, PaymentMethodTokenizationData, PaymentsApproveData,
|
MandateRevokeRequestData, PaymentMethodTokenizationData, PaymentsApproveData,
|
||||||
@ -42,7 +47,8 @@ use hyperswitch_domain_models::{
|
|||||||
},
|
},
|
||||||
router_response_types::{
|
router_response_types::{
|
||||||
revenue_recovery::{
|
revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
|
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
|
||||||
|
RevenueRecoveryRecordBackResponse,
|
||||||
},
|
},
|
||||||
AcceptDisputeResponse, AuthenticationResponseData, DefendDisputeResponse,
|
AcceptDisputeResponse, AuthenticationResponseData, DefendDisputeResponse,
|
||||||
MandateRevokeResponseData, PaymentsResponseData, RefundsResponseData, RetrieveFileResponse,
|
MandateRevokeResponseData, PaymentsResponseData, RefundsResponseData, RetrieveFileResponse,
|
||||||
@ -98,8 +104,8 @@ use hyperswitch_interfaces::{
|
|||||||
},
|
},
|
||||||
refunds_v2::{RefundExecuteV2, RefundSyncV2, RefundV2},
|
refunds_v2::{RefundExecuteV2, RefundSyncV2, RefundV2},
|
||||||
revenue_recovery_v2::{
|
revenue_recovery_v2::{
|
||||||
BillingConnectorPaymentsSyncIntegrationV2, RevenueRecoveryRecordBackV2,
|
BillingConnectorInvoiceSyncIntegrationV2, BillingConnectorPaymentsSyncIntegrationV2,
|
||||||
RevenueRecoveryV2,
|
RevenueRecoveryRecordBackV2, RevenueRecoveryV2,
|
||||||
},
|
},
|
||||||
ConnectorAccessTokenV2, ConnectorMandateRevokeV2, ConnectorVerifyWebhookSourceV2,
|
ConnectorAccessTokenV2, ConnectorMandateRevokeV2, ConnectorVerifyWebhookSourceV2,
|
||||||
},
|
},
|
||||||
@ -2757,6 +2763,7 @@ macro_rules! default_imp_for_new_connector_integration_revenue_recovery {
|
|||||||
$( impl RevenueRecoveryV2 for $path::$connector {}
|
$( impl RevenueRecoveryV2 for $path::$connector {}
|
||||||
impl BillingConnectorPaymentsSyncIntegrationV2 for $path::$connector {}
|
impl BillingConnectorPaymentsSyncIntegrationV2 for $path::$connector {}
|
||||||
impl RevenueRecoveryRecordBackV2 for $path::$connector {}
|
impl RevenueRecoveryRecordBackV2 for $path::$connector {}
|
||||||
|
impl BillingConnectorInvoiceSyncIntegrationV2 for $path::$connector {}
|
||||||
impl
|
impl
|
||||||
ConnectorIntegrationV2<
|
ConnectorIntegrationV2<
|
||||||
RecoveryRecordBack,
|
RecoveryRecordBack,
|
||||||
@ -2773,6 +2780,14 @@ macro_rules! default_imp_for_new_connector_integration_revenue_recovery {
|
|||||||
BillingConnectorPaymentsSyncResponse,
|
BillingConnectorPaymentsSyncResponse,
|
||||||
> for $path::$connector
|
> for $path::$connector
|
||||||
{}
|
{}
|
||||||
|
impl
|
||||||
|
ConnectorIntegrationV2<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
BillingConnectorInvoiceSyncFlowData,
|
||||||
|
BillingConnectorInvoiceSyncRequest,
|
||||||
|
BillingConnectorInvoiceSyncResponse,
|
||||||
|
> for $path::$connector
|
||||||
|
{}
|
||||||
)*
|
)*
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,3 +155,6 @@ pub struct UasFlowData {
|
|||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct BillingConnectorPaymentsSyncFlowData;
|
pub struct BillingConnectorPaymentsSyncFlowData;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct BillingConnectorInvoiceSyncFlowData;
|
||||||
|
|||||||
@ -2,3 +2,6 @@
|
|||||||
pub struct BillingConnectorPaymentsSync;
|
pub struct BillingConnectorPaymentsSync;
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct RecoveryRecordBack;
|
pub struct RecoveryRecordBack;
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct BillingConnectorInvoiceSync;
|
||||||
|
|||||||
@ -15,3 +15,8 @@ pub struct RevenueRecoveryRecordBackRequest {
|
|||||||
pub attempt_status: common_enums::AttemptStatus,
|
pub attempt_status: common_enums::AttemptStatus,
|
||||||
pub connector_transaction_id: Option<common_utils::types::ConnectorTransactionId>,
|
pub connector_transaction_id: Option<common_utils::types::ConnectorTransactionId>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Clone)]
|
||||||
|
pub struct BillingConnectorInvoiceSyncRequest {
|
||||||
|
pub billing_connector_invoice_id: String,
|
||||||
|
}
|
||||||
|
|||||||
@ -34,3 +34,20 @@ pub struct BillingConnectorPaymentsSyncResponse {
|
|||||||
pub struct RevenueRecoveryRecordBackResponse {
|
pub struct RevenueRecoveryRecordBackResponse {
|
||||||
pub merchant_reference_id: common_utils::id_type::PaymentReferenceId,
|
pub merchant_reference_id: common_utils::id_type::PaymentReferenceId,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub struct BillingConnectorInvoiceSyncResponse {
|
||||||
|
/// transaction amount against invoice, accepted in minor unit.
|
||||||
|
pub amount: MinorUnit,
|
||||||
|
/// currency of the transaction
|
||||||
|
pub currency: common_enums::enums::Currency,
|
||||||
|
/// merchant reference id at billing connector. ex: invoice_id
|
||||||
|
pub merchant_reference_id: common_utils::id_type::PaymentReferenceId,
|
||||||
|
/// No of attempts made against an invoice
|
||||||
|
pub retry_count: Option<u16>,
|
||||||
|
/// Billing Address of the customer for Invoice
|
||||||
|
pub billing_address: Option<api_models::payments::Address>,
|
||||||
|
/// creation time of the invoice
|
||||||
|
pub created_at: Option<PrimitiveDateTime>,
|
||||||
|
/// Ending time of Invoice
|
||||||
|
pub ends_at: Option<PrimitiveDateTime>,
|
||||||
|
}
|
||||||
|
|||||||
@ -5,13 +5,16 @@ use crate::{
|
|||||||
router_flow_types::{
|
router_flow_types::{
|
||||||
mandate_revoke::MandateRevoke, revenue_recovery::RecoveryRecordBack, AccessTokenAuth,
|
mandate_revoke::MandateRevoke, revenue_recovery::RecoveryRecordBack, AccessTokenAuth,
|
||||||
Authenticate, AuthenticationConfirmation, Authorize, AuthorizeSessionToken,
|
Authenticate, AuthenticationConfirmation, Authorize, AuthorizeSessionToken,
|
||||||
BillingConnectorPaymentsSync, CalculateTax, Capture, CompleteAuthorize,
|
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, CalculateTax, Capture,
|
||||||
CreateConnectorCustomer, Execute, IncrementalAuthorization, PSync, PaymentMethodToken,
|
CompleteAuthorize, CreateConnectorCustomer, Execute, IncrementalAuthorization, PSync,
|
||||||
PostAuthenticate, PostSessionTokens, PreAuthenticate, PreProcessing, RSync,
|
PaymentMethodToken, PostAuthenticate, PostSessionTokens, PreAuthenticate, PreProcessing,
|
||||||
SdkSessionUpdate, Session, SetupMandate, UpdateMetadata, VerifyWebhookSource, Void,
|
RSync, SdkSessionUpdate, Session, SetupMandate, UpdateMetadata, VerifyWebhookSource, Void,
|
||||||
},
|
},
|
||||||
router_request_types::{
|
router_request_types::{
|
||||||
revenue_recovery::{BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest},
|
revenue_recovery::{
|
||||||
|
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
|
||||||
|
RevenueRecoveryRecordBackRequest,
|
||||||
|
},
|
||||||
unified_authentication_service::{
|
unified_authentication_service::{
|
||||||
UasAuthenticationRequestData, UasAuthenticationResponseData,
|
UasAuthenticationRequestData, UasAuthenticationResponseData,
|
||||||
UasConfirmationRequestData, UasPostAuthenticationRequestData,
|
UasConfirmationRequestData, UasPostAuthenticationRequestData,
|
||||||
@ -27,7 +30,8 @@ use crate::{
|
|||||||
},
|
},
|
||||||
router_response_types::{
|
router_response_types::{
|
||||||
revenue_recovery::{
|
revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
|
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
|
||||||
|
RevenueRecoveryRecordBackResponse,
|
||||||
},
|
},
|
||||||
MandateRevokeResponseData, PaymentsResponseData, RefundsResponseData,
|
MandateRevokeResponseData, PaymentsResponseData, RefundsResponseData,
|
||||||
TaxCalculationResponseData, VerifyWebhookSourceResponseData,
|
TaxCalculationResponseData, VerifyWebhookSourceResponseData,
|
||||||
@ -109,3 +113,9 @@ pub type BillingConnectorPaymentsSyncRouterData = RouterData<
|
|||||||
BillingConnectorPaymentsSyncRequest,
|
BillingConnectorPaymentsSyncRequest,
|
||||||
BillingConnectorPaymentsSyncResponse,
|
BillingConnectorPaymentsSyncResponse,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
pub type BillingConnectorInvoiceSyncRouterData = RouterData<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
BillingConnectorInvoiceSyncRequest,
|
||||||
|
BillingConnectorInvoiceSyncResponse,
|
||||||
|
>;
|
||||||
|
|||||||
@ -1,12 +1,16 @@
|
|||||||
//! Revenue Recovery Interface
|
//! Revenue Recovery Interface
|
||||||
|
|
||||||
use hyperswitch_domain_models::{
|
use hyperswitch_domain_models::{
|
||||||
router_flow_types::{BillingConnectorPaymentsSync, RecoveryRecordBack},
|
router_flow_types::{
|
||||||
|
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
|
||||||
|
},
|
||||||
router_request_types::revenue_recovery::{
|
router_request_types::revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest,
|
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
|
||||||
|
RevenueRecoveryRecordBackRequest,
|
||||||
},
|
},
|
||||||
router_response_types::revenue_recovery::{
|
router_response_types::revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
|
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
|
||||||
|
RevenueRecoveryRecordBackResponse,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,7 +21,10 @@ use super::ConnectorIntegration;
|
|||||||
/// trait RevenueRecovery
|
/// trait RevenueRecovery
|
||||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
pub trait RevenueRecovery:
|
pub trait RevenueRecovery:
|
||||||
ConnectorCommon + BillingConnectorPaymentsSyncIntegration + RevenueRecoveryRecordBack
|
ConnectorCommon
|
||||||
|
+ BillingConnectorPaymentsSyncIntegration
|
||||||
|
+ RevenueRecoveryRecordBack
|
||||||
|
+ BillingConnectorInvoiceSyncIntegration
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -41,6 +48,16 @@ pub trait RevenueRecoveryRecordBack:
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// trait BillingConnectorInvoiceSyncIntegration
|
||||||
|
pub trait BillingConnectorInvoiceSyncIntegration:
|
||||||
|
ConnectorIntegration<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
BillingConnectorInvoiceSyncRequest,
|
||||||
|
BillingConnectorInvoiceSyncResponse,
|
||||||
|
>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
#[cfg(not(all(feature = "v2", feature = "revenue_recovery")))]
|
#[cfg(not(all(feature = "v2", feature = "revenue_recovery")))]
|
||||||
/// trait RevenueRecovery
|
/// trait RevenueRecovery
|
||||||
pub trait RevenueRecovery {}
|
pub trait RevenueRecovery {}
|
||||||
|
|||||||
@ -2,14 +2,19 @@
|
|||||||
|
|
||||||
use hyperswitch_domain_models::{
|
use hyperswitch_domain_models::{
|
||||||
router_data_v2::flow_common_types::{
|
router_data_v2::flow_common_types::{
|
||||||
BillingConnectorPaymentsSyncFlowData, RevenueRecoveryRecordBackData,
|
BillingConnectorInvoiceSyncFlowData, BillingConnectorPaymentsSyncFlowData,
|
||||||
|
RevenueRecoveryRecordBackData,
|
||||||
|
},
|
||||||
|
router_flow_types::{
|
||||||
|
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
|
||||||
},
|
},
|
||||||
router_flow_types::{BillingConnectorPaymentsSync, RecoveryRecordBack},
|
|
||||||
router_request_types::revenue_recovery::{
|
router_request_types::revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest,
|
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
|
||||||
|
RevenueRecoveryRecordBackRequest,
|
||||||
},
|
},
|
||||||
router_response_types::revenue_recovery::{
|
router_response_types::revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
|
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
|
||||||
|
RevenueRecoveryRecordBackResponse,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -17,7 +22,9 @@ use crate::connector_integration_v2::ConnectorIntegrationV2;
|
|||||||
|
|
||||||
/// trait RevenueRecoveryV2
|
/// trait RevenueRecoveryV2
|
||||||
pub trait RevenueRecoveryV2:
|
pub trait RevenueRecoveryV2:
|
||||||
BillingConnectorPaymentsSyncIntegrationV2 + RevenueRecoveryRecordBackV2
|
BillingConnectorPaymentsSyncIntegrationV2
|
||||||
|
+ RevenueRecoveryRecordBackV2
|
||||||
|
+ BillingConnectorInvoiceSyncIntegrationV2
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -42,3 +49,14 @@ pub trait RevenueRecoveryRecordBackV2:
|
|||||||
>
|
>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// trait BillingConnectorInvoiceSyncIntegrationV2
|
||||||
|
pub trait BillingConnectorInvoiceSyncIntegrationV2:
|
||||||
|
ConnectorIntegrationV2<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
BillingConnectorInvoiceSyncFlowData,
|
||||||
|
BillingConnectorInvoiceSyncRequest,
|
||||||
|
BillingConnectorInvoiceSyncResponse,
|
||||||
|
>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|||||||
@ -19,9 +19,13 @@ use hyperswitch_domain_models::{
|
|||||||
Authenticate, AuthenticationConfirmation, PostAuthenticate, PreAuthenticate,
|
Authenticate, AuthenticationConfirmation, PostAuthenticate, PreAuthenticate,
|
||||||
},
|
},
|
||||||
webhooks::VerifyWebhookSource,
|
webhooks::VerifyWebhookSource,
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
},
|
},
|
||||||
router_request_types::{
|
router_request_types::{
|
||||||
revenue_recovery::{BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest},
|
revenue_recovery::{
|
||||||
|
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
|
||||||
|
RevenueRecoveryRecordBackRequest,
|
||||||
|
},
|
||||||
unified_authentication_service::{
|
unified_authentication_service::{
|
||||||
UasAuthenticationRequestData, UasAuthenticationResponseData,
|
UasAuthenticationRequestData, UasAuthenticationResponseData,
|
||||||
UasConfirmationRequestData, UasPostAuthenticationRequestData,
|
UasConfirmationRequestData, UasPostAuthenticationRequestData,
|
||||||
@ -39,7 +43,8 @@ use hyperswitch_domain_models::{
|
|||||||
},
|
},
|
||||||
router_response_types::{
|
router_response_types::{
|
||||||
revenue_recovery::{
|
revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
|
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
|
||||||
|
RevenueRecoveryRecordBackResponse,
|
||||||
},
|
},
|
||||||
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
|
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
|
||||||
PaymentsResponseData, RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
|
PaymentsResponseData, RefundsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
|
||||||
@ -245,3 +250,10 @@ pub type BillingConnectorPaymentsSyncType = dyn ConnectorIntegration<
|
|||||||
BillingConnectorPaymentsSyncRequest,
|
BillingConnectorPaymentsSyncRequest,
|
||||||
BillingConnectorPaymentsSyncResponse,
|
BillingConnectorPaymentsSyncResponse,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
|
/// Type alias for `ConnectorIntegration<BillingConnectorInvoiceSync, BillingConnectorInvoiceSyncRequest, BillingConnectorInvoiceSyncResponse>`
|
||||||
|
pub type BillingConnectorInvoiceSyncType = dyn ConnectorIntegration<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
BillingConnectorInvoiceSyncRequest,
|
||||||
|
BillingConnectorInvoiceSyncResponse,
|
||||||
|
>;
|
||||||
|
|||||||
@ -15,7 +15,7 @@ pub mod update_metadata_flow;
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
use hyperswitch_domain_models::router_flow_types::{
|
use hyperswitch_domain_models::router_flow_types::{
|
||||||
BillingConnectorPaymentsSync, RecoveryRecordBack,
|
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, RecoveryRecordBack,
|
||||||
};
|
};
|
||||||
use hyperswitch_domain_models::{
|
use hyperswitch_domain_models::{
|
||||||
mandates::CustomerAcceptance,
|
mandates::CustomerAcceptance,
|
||||||
@ -2018,3 +2018,45 @@ default_imp_for_revenue_recovery_record_back!(
|
|||||||
connector::Wellsfargopayout,
|
connector::Wellsfargopayout,
|
||||||
connector::Wise
|
connector::Wise
|
||||||
);
|
);
|
||||||
|
|
||||||
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
|
macro_rules! default_imp_for_billing_connector_invoice_sync {
|
||||||
|
($($path:ident::$connector:ident),*) => {
|
||||||
|
$(
|
||||||
|
impl api::BillingConnectorInvoiceSyncIntegration for $path::$connector {}
|
||||||
|
impl
|
||||||
|
services::ConnectorIntegration<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
types::BillingConnectorInvoiceSyncRequest,
|
||||||
|
types::BillingConnectorInvoiceSyncResponse,
|
||||||
|
> for $path::$connector
|
||||||
|
{}
|
||||||
|
)*
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
|
#[cfg(feature = "dummy_connector")]
|
||||||
|
impl<const T: u8> api::BillingConnectorInvoiceSyncIntegration for connector::DummyConnector<T> {}
|
||||||
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
|
#[cfg(feature = "dummy_connector")]
|
||||||
|
impl<const T: u8>
|
||||||
|
services::ConnectorIntegration<
|
||||||
|
BillingConnectorInvoiceSync,
|
||||||
|
types::BillingConnectorInvoiceSyncRequest,
|
||||||
|
types::BillingConnectorInvoiceSyncResponse,
|
||||||
|
> for connector::DummyConnector<T>
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#[cfg(all(feature = "v2", feature = "revenue_recovery"))]
|
||||||
|
default_imp_for_billing_connector_invoice_sync!(
|
||||||
|
connector::Adyenplatform,
|
||||||
|
connector::Ebanx,
|
||||||
|
connector::Gpayments,
|
||||||
|
connector::Netcetera,
|
||||||
|
connector::Plaid,
|
||||||
|
connector::Signifyd,
|
||||||
|
connector::Stripe,
|
||||||
|
connector::Threedsecureio,
|
||||||
|
connector::Wellsfargopayout,
|
||||||
|
connector::Wise
|
||||||
|
);
|
||||||
|
|||||||
@ -106,6 +106,13 @@ pub type BoxedFilesConnectorIntegrationInterface<T, Req, Resp> =
|
|||||||
BoxedConnectorIntegrationInterface<T, common_types::FilesFlowData, Req, Resp>;
|
BoxedConnectorIntegrationInterface<T, common_types::FilesFlowData, Req, Resp>;
|
||||||
pub type BoxedRevenueRecoveryRecordBackInterface<T, Req, Res> =
|
pub type BoxedRevenueRecoveryRecordBackInterface<T, Req, Res> =
|
||||||
BoxedConnectorIntegrationInterface<T, common_types::RevenueRecoveryRecordBackData, Req, Res>;
|
BoxedConnectorIntegrationInterface<T, common_types::RevenueRecoveryRecordBackData, Req, Res>;
|
||||||
|
pub type BoxedBillingConnectorInvoiceSyncIntegrationInterface<T, Req, Res> =
|
||||||
|
BoxedConnectorIntegrationInterface<
|
||||||
|
T,
|
||||||
|
common_types::BillingConnectorInvoiceSyncFlowData,
|
||||||
|
Req,
|
||||||
|
Res,
|
||||||
|
>;
|
||||||
|
|
||||||
pub type BoxedUnifiedAuthenticationServiceInterface<T, Req, Resp> =
|
pub type BoxedUnifiedAuthenticationServiceInterface<T, Req, Resp> =
|
||||||
BoxedConnectorIntegrationInterface<T, common_types::UasFlowData, Req, Resp>;
|
BoxedConnectorIntegrationInterface<T, common_types::UasFlowData, Req, Resp>;
|
||||||
|
|||||||
@ -57,7 +57,10 @@ pub use hyperswitch_domain_models::{
|
|||||||
WebhookSourceVerifyData,
|
WebhookSourceVerifyData,
|
||||||
},
|
},
|
||||||
router_request_types::{
|
router_request_types::{
|
||||||
revenue_recovery::{BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest},
|
revenue_recovery::{
|
||||||
|
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
|
||||||
|
RevenueRecoveryRecordBackRequest,
|
||||||
|
},
|
||||||
unified_authentication_service::{
|
unified_authentication_service::{
|
||||||
UasAuthenticationRequestData, UasAuthenticationResponseData,
|
UasAuthenticationRequestData, UasAuthenticationResponseData,
|
||||||
UasConfirmationRequestData, UasPostAuthenticationRequestData,
|
UasConfirmationRequestData, UasPostAuthenticationRequestData,
|
||||||
@ -79,7 +82,8 @@ pub use hyperswitch_domain_models::{
|
|||||||
},
|
},
|
||||||
router_response_types::{
|
router_response_types::{
|
||||||
revenue_recovery::{
|
revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
|
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
|
||||||
|
RevenueRecoveryRecordBackResponse,
|
||||||
},
|
},
|
||||||
AcceptDisputeResponse, CaptureSyncResponse, DefendDisputeResponse, MandateReference,
|
AcceptDisputeResponse, CaptureSyncResponse, DefendDisputeResponse, MandateReference,
|
||||||
MandateRevokeResponseData, PaymentsResponseData, PreprocessingResponseId,
|
MandateRevokeResponseData, PaymentsResponseData, PreprocessingResponseId,
|
||||||
|
|||||||
@ -57,7 +57,8 @@ pub use hyperswitch_interfaces::{
|
|||||||
},
|
},
|
||||||
fraud_check::FraudCheck,
|
fraud_check::FraudCheck,
|
||||||
revenue_recovery::{
|
revenue_recovery::{
|
||||||
BillingConnectorPaymentsSyncIntegration, RevenueRecovery, RevenueRecoveryRecordBack,
|
BillingConnectorInvoiceSyncIntegration, BillingConnectorPaymentsSyncIntegration,
|
||||||
|
RevenueRecovery, RevenueRecoveryRecordBack,
|
||||||
},
|
},
|
||||||
revenue_recovery_v2::RevenueRecoveryV2,
|
revenue_recovery_v2::RevenueRecoveryV2,
|
||||||
BoxedConnector, Connector, ConnectorAccessToken, ConnectorAccessTokenV2, ConnectorCommon,
|
BoxedConnector, Connector, ConnectorAccessToken, ConnectorAccessTokenV2, ConnectorCommon,
|
||||||
|
|||||||
Reference in New Issue
Block a user