Skip to content

Commit 9e4135c

Browse files
NISHANTH1221Nishanth Challahyperswitch-bot[bot]
authored
feat(core): add additional revenue recovery call flow (#7402)
Co-authored-by: Nishanth Challa <[email protected]> Co-authored-by: hyperswitch-bot[bot] <148525504+hyperswitch-bot[bot]@users.noreply.github.com>
1 parent 5a526fd commit 9e4135c

File tree

23 files changed

+309
-20
lines changed

23 files changed

+309
-20
lines changed

config/config.example.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,3 +883,6 @@ entity_logo_url = "https://example.com/logo.svg" # Logo URL of the entity to be
883883
foreground_color = "#000000" # Foreground color of email text
884884
primary_color = "#006DF9" # Primary color of email body
885885
background_color = "#FFFFFF" # Background color of email body
886+
887+
[additional_revenue_recovery_details_call]
888+
connectors_with_additional_revenue_recovery_details_call = "stripebilling" # List of connectors which has additional revenue recovery details api-call

config/development.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,9 @@ connectors_with_delayed_session_response = "trustpay,payme"
724724
[webhook_source_verification_call]
725725
connectors_with_webhook_source_verification_call = "paypal"
726726

727+
[additional_revenue_recovery_details_call]
728+
connectors_with_additional_revenue_recovery_details_call = "stripebilling"
729+
727730
[mandates.supported_payment_methods]
728731
bank_debit.ach = { connector_list = "gocardless,adyen,stripe" }
729732
bank_debit.becs = { connector_list = "gocardless,stripe,adyen" }

config/docker_compose.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,9 @@ connectors_with_delayed_session_response = "trustpay,payme"
316316
[webhook_source_verification_call]
317317
connectors_with_webhook_source_verification_call = "paypal"
318318

319+
[additional_revenue_recovery_details_call]
320+
connectors_with_additional_revenue_recovery_details_call = "stripebilling"
321+
319322
[scheduler]
320323
stream = "SCHEDULER_STREAM"
321324

crates/hyperswitch_connectors/src/default_implementations.rs

Lines changed: 105 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,11 @@ use hyperswitch_domain_models::{
3333
PreProcessing, Reject, SdkSessionUpdate,
3434
},
3535
webhooks::VerifyWebhookSource,
36-
Authenticate, AuthenticationConfirmation, PostAuthenticate, PreAuthenticate,
36+
Authenticate, AuthenticationConfirmation, GetAdditionalRevenueRecoveryDetails,
37+
PostAuthenticate, PreAuthenticate,
3738
},
3839
router_request_types::{
40+
revenue_recovery::GetAdditionalRevenueRecoveryRequestData,
3941
unified_authentication_service::{
4042
UasAuthenticationRequestData, UasAuthenticationResponseData,
4143
UasConfirmationRequestData, UasPostAuthenticationRequestData,
@@ -49,9 +51,10 @@ use hyperswitch_domain_models::{
4951
SubmitEvidenceRequestData, UploadFileRequestData, VerifyWebhookSourceRequestData,
5052
},
5153
router_response_types::{
52-
AcceptDisputeResponse, DefendDisputeResponse, MandateRevokeResponseData,
53-
PaymentsResponseData, RetrieveFileResponse, SubmitEvidenceResponse,
54-
TaxCalculationResponseData, UploadFileResponse, VerifyWebhookSourceResponseData,
54+
revenue_recovery::GetAdditionalRevenueRecoveryResponseData, AcceptDisputeResponse,
55+
DefendDisputeResponse, MandateRevokeResponseData, PaymentsResponseData,
56+
RetrieveFileResponse, SubmitEvidenceResponse, TaxCalculationResponseData,
57+
UploadFileResponse, VerifyWebhookSourceResponseData,
5558
},
5659
};
5760
#[cfg(feature = "frm")]
@@ -75,6 +78,7 @@ use hyperswitch_interfaces::{
7578
PaymentSessionUpdate, PaymentsCompleteAuthorize, PaymentsPostProcessing,
7679
PaymentsPreProcessing, TaxCalculation,
7780
},
81+
revenue_recovery::{AdditionalRevenueRecovery, RevenueRecovery},
7882
ConnectorIntegration, ConnectorMandateRevoke, ConnectorRedirectResponse, UasAuthentication,
7983
UasAuthenticationConfirmation, UasPostAuthentication, UasPreAuthentication,
8084
UnifiedAuthenticationService,
@@ -3522,3 +3526,100 @@ default_imp_for_uas_authentication_confirmation!(
35223526
connectors::Zen,
35233527
connectors::Zsl
35243528
);
3529+
3530+
macro_rules! default_imp_for_additional_revenue_recovery_call {
3531+
($($path:ident::$connector:ident),*) => {
3532+
$( impl RevenueRecovery for $path::$connector {}
3533+
impl AdditionalRevenueRecovery for $path::$connector {}
3534+
impl
3535+
ConnectorIntegration<
3536+
GetAdditionalRevenueRecoveryDetails,
3537+
GetAdditionalRevenueRecoveryRequestData,
3538+
GetAdditionalRevenueRecoveryResponseData
3539+
> for $path::$connector
3540+
{}
3541+
)*
3542+
};
3543+
}
3544+
3545+
default_imp_for_additional_revenue_recovery_call!(
3546+
connectors::Aci,
3547+
connectors::Airwallex,
3548+
connectors::Amazonpay,
3549+
connectors::Authorizedotnet,
3550+
connectors::Bambora,
3551+
connectors::Bamboraapac,
3552+
connectors::Bankofamerica,
3553+
connectors::Billwerk,
3554+
connectors::Bluesnap,
3555+
connectors::Bitpay,
3556+
connectors::Braintree,
3557+
connectors::Boku,
3558+
connectors::Cashtocode,
3559+
connectors::Chargebee,
3560+
connectors::Checkout,
3561+
connectors::Coinbase,
3562+
connectors::Coingate,
3563+
connectors::Cryptopay,
3564+
connectors::CtpMastercard,
3565+
connectors::Cybersource,
3566+
connectors::Datatrans,
3567+
connectors::Deutschebank,
3568+
connectors::Digitalvirgo,
3569+
connectors::Dlocal,
3570+
connectors::Elavon,
3571+
connectors::Fiserv,
3572+
connectors::Fiservemea,
3573+
connectors::Fiuu,
3574+
connectors::Forte,
3575+
connectors::Getnet,
3576+
connectors::Globalpay,
3577+
connectors::Globepay,
3578+
connectors::Gocardless,
3579+
connectors::Helcim,
3580+
connectors::Iatapay,
3581+
connectors::Inespay,
3582+
connectors::Itaubank,
3583+
connectors::Jpmorgan,
3584+
connectors::Klarna,
3585+
connectors::Nomupay,
3586+
connectors::Noon,
3587+
connectors::Novalnet,
3588+
connectors::Nexinets,
3589+
connectors::Nexixpay,
3590+
connectors::Nuvei,
3591+
connectors::Opayo,
3592+
connectors::Opennode,
3593+
connectors::Payeezy,
3594+
connectors::Paystack,
3595+
connectors::Payu,
3596+
connectors::Powertranz,
3597+
connectors::Prophetpay,
3598+
connectors::Mifinity,
3599+
connectors::Mollie,
3600+
connectors::Moneris,
3601+
connectors::Multisafepay,
3602+
connectors::Paybox,
3603+
connectors::Payme,
3604+
connectors::Placetopay,
3605+
connectors::Rapyd,
3606+
connectors::Razorpay,
3607+
connectors::Recurly,
3608+
connectors::Redsys,
3609+
connectors::Shift4,
3610+
connectors::Stax,
3611+
connectors::Square,
3612+
connectors::Stripebilling,
3613+
connectors::Taxjar,
3614+
connectors::Thunes,
3615+
connectors::Trustpay,
3616+
connectors::Tsys,
3617+
connectors::UnifiedAuthenticationService,
3618+
connectors::Worldline,
3619+
connectors::Worldpay,
3620+
connectors::Wellsfargo,
3621+
connectors::Volt,
3622+
connectors::Xendit,
3623+
connectors::Zen,
3624+
connectors::Zsl
3625+
);

crates/hyperswitch_domain_models/src/router_data_v2/flow_common_types.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,6 @@ pub struct UasFlowData {
149149
pub authenticate_by: String,
150150
pub source_authentication_id: String,
151151
}
152+
153+
#[derive(Debug, Clone)]
154+
pub struct GetAdditionalRevenueRecoveryFlowCommonData;

crates/hyperswitch_domain_models/src/router_flow_types.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ pub mod mandate_revoke;
66
pub mod payments;
77
pub mod payouts;
88
pub mod refunds;
9+
pub mod revenue_recovery;
910
pub mod unified_authentication_service;
1011
pub mod webhooks;
1112

@@ -16,5 +17,6 @@ pub use fraud_check::*;
1617
pub use payments::*;
1718
pub use payouts::*;
1819
pub use refunds::*;
20+
pub use revenue_recovery::*;
1921
pub use unified_authentication_service::*;
2022
pub use webhooks::*;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#[derive(Debug, Clone)]
2+
pub struct GetAdditionalRevenueRecoveryDetails;

crates/hyperswitch_domain_models/src/router_request_types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod authentication;
22
pub mod fraud_check;
3+
pub mod revenue_recovery;
34
pub mod unified_authentication_service;
45
use api_models::payments::{AdditionalPaymentData, RequestSurchargeDetails};
56
use common_utils::{consts, errors, ext_traits::OptionExt, id_type, pii, types::MinorUnit};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#[derive(Debug, Clone)]
2+
pub struct GetAdditionalRevenueRecoveryRequestData {
3+
/// unique id for making additional revenue recovery call
4+
pub additional_revenue_recovery_id: String,
5+
}

crates/hyperswitch_domain_models/src/router_response_types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
pub mod disputes;
22
pub mod fraud_check;
3+
pub mod revenue_recovery;
34
use std::collections::HashMap;
45

56
use common_utils::{request::Method, types::MinorUnit};

0 commit comments

Comments
 (0)