mirror of
				https://github.com/juspay/hyperswitch.git
				synced 2025-11-01 02:57:02 +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:
		 CHALLA NISHANTH BABU
					CHALLA NISHANTH BABU
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							600137275f
						
					
				
				
					commit
					3d0dd5bd1a
				
			| @ -155,3 +155,6 @@ pub struct UasFlowData { | ||||
|  | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct BillingConnectorPaymentsSyncFlowData; | ||||
|  | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct BillingConnectorInvoiceSyncFlowData; | ||||
|  | ||||
| @ -2,3 +2,6 @@ | ||||
| pub struct BillingConnectorPaymentsSync; | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct RecoveryRecordBack; | ||||
|  | ||||
| #[derive(Debug, Clone)] | ||||
| pub struct BillingConnectorInvoiceSync; | ||||
|  | ||||
| @ -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, | ||||
| } | ||||
|  | ||||
| @ -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>, | ||||
| } | ||||
|  | ||||
| @ -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, | ||||
| >; | ||||
|  | ||||
		Reference in New Issue
	
	Block a user