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:
CHALLA NISHANTH BABU
2025-04-29 12:25:31 +05:30
committed by GitHub
parent 600137275f
commit 3d0dd5bd1a
14 changed files with 294 additions and 34 deletions

View File

@ -155,3 +155,6 @@ pub struct UasFlowData {
#[derive(Debug, Clone)]
pub struct BillingConnectorPaymentsSyncFlowData;
#[derive(Debug, Clone)]
pub struct BillingConnectorInvoiceSyncFlowData;

View File

@ -2,3 +2,6 @@
pub struct BillingConnectorPaymentsSync;
#[derive(Debug, Clone)]
pub struct RecoveryRecordBack;
#[derive(Debug, Clone)]
pub struct BillingConnectorInvoiceSync;

View File

@ -15,3 +15,8 @@ pub struct RevenueRecoveryRecordBackRequest {
pub attempt_status: common_enums::AttemptStatus,
pub connector_transaction_id: Option<common_utils::types::ConnectorTransactionId>,
}
#[derive(Debug, Clone)]
pub struct BillingConnectorInvoiceSyncRequest {
pub billing_connector_invoice_id: String,
}

View File

@ -34,3 +34,20 @@ pub struct BillingConnectorPaymentsSyncResponse {
pub struct RevenueRecoveryRecordBackResponse {
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>,
}

View File

@ -5,13 +5,16 @@ use crate::{
router_flow_types::{
mandate_revoke::MandateRevoke, revenue_recovery::RecoveryRecordBack, AccessTokenAuth,
Authenticate, AuthenticationConfirmation, Authorize, AuthorizeSessionToken,
BillingConnectorPaymentsSync, CalculateTax, Capture, CompleteAuthorize,
CreateConnectorCustomer, Execute, IncrementalAuthorization, PSync, PaymentMethodToken,
PostAuthenticate, PostSessionTokens, PreAuthenticate, PreProcessing, RSync,
SdkSessionUpdate, Session, SetupMandate, UpdateMetadata, VerifyWebhookSource, Void,
BillingConnectorInvoiceSync, BillingConnectorPaymentsSync, CalculateTax, Capture,
CompleteAuthorize, CreateConnectorCustomer, Execute, IncrementalAuthorization, PSync,
PaymentMethodToken, PostAuthenticate, PostSessionTokens, PreAuthenticate, PreProcessing,
RSync, SdkSessionUpdate, Session, SetupMandate, UpdateMetadata, VerifyWebhookSource, Void,
},
router_request_types::{
revenue_recovery::{BillingConnectorPaymentsSyncRequest, RevenueRecoveryRecordBackRequest},
revenue_recovery::{
BillingConnectorInvoiceSyncRequest, BillingConnectorPaymentsSyncRequest,
RevenueRecoveryRecordBackRequest,
},
unified_authentication_service::{
UasAuthenticationRequestData, UasAuthenticationResponseData,
UasConfirmationRequestData, UasPostAuthenticationRequestData,
@ -27,7 +30,8 @@ use crate::{
},
router_response_types::{
revenue_recovery::{
BillingConnectorPaymentsSyncResponse, RevenueRecoveryRecordBackResponse,
BillingConnectorInvoiceSyncResponse, BillingConnectorPaymentsSyncResponse,
RevenueRecoveryRecordBackResponse,
},
MandateRevokeResponseData, PaymentsResponseData, RefundsResponseData,
TaxCalculationResponseData, VerifyWebhookSourceResponseData,
@ -109,3 +113,9 @@ pub type BillingConnectorPaymentsSyncRouterData = RouterData<
BillingConnectorPaymentsSyncRequest,
BillingConnectorPaymentsSyncResponse,
>;
pub type BillingConnectorInvoiceSyncRouterData = RouterData<
BillingConnectorInvoiceSync,
BillingConnectorInvoiceSyncRequest,
BillingConnectorInvoiceSyncResponse,
>;