Open source, composable payments platform | PCI compliant | SaaS and Self-host options | Enables connectivity to multiple payment, payout, fraud, vault and tokenization providers | Uplifts authorization with intelligent routing and revenue recovery | Reduce payment processing costs with cost observability | Reduces payment ops with reconciliation
Rust adyenbeginner-friendlyfeaturedfinancefintechhacktoberfesthigh-performanceopen-sourceorchestrationpaymentpayment-gatewaypayment-integrationpayment-processingpaymentspayments-platformrestful-apirustsdkstripeworks-with-react
refactor(revenue_recovery): move the recovery payments create API under /v2/recovery (#14776)
CHALLA NISHANTH BABUa61d6a68ef68
diff --git a/api-reference/v2/openapi_spec_v2.json b/api-reference/v2/openapi_spec_v2.jsonindex 39851c1cef..b4ed73615a 100644--- a/api-reference/v2/openapi_spec_v2.json+++ b/api-reference/v2/openapi_spec_v2.json@@ -4866,7 +4866,7 @@]}},- "/v2/payments/recovery": {+ "/v2/recovery": {"post": {"tags": ["Revenue Recovery"diff --git a/api-reference/v2/revenue-recovery/revenue-recovery--create.mdx b/api-reference/v2/revenue-recovery/revenue-recovery--create.mdxindex c9a9c6cb84..48fff0ddd6 100644--- a/api-reference/v2/revenue-recovery/revenue-recovery--create.mdx+++ b/api-reference/v2/revenue-recovery/revenue-recovery--create.mdx@@ -1,3 +1,3 @@----openapi: post /v2/payments/recovery+openapi: post /v2/recovery---diff --git a/crates/openapi/src/routes/revenue_recovery.rs b/crates/openapi/src/routes/revenue_recovery.rsindex f4327d1f50..c68ebafe6d 100644--- a/crates/openapi/src/routes/revenue_recovery.rs+++ b/crates/openapi/src/routes/revenue_recovery.rs@@ -29,7 +29,7 @@ pub async fn revenue_recovery_pt_retrieve_api() {}/// or recording an externally successful payment.#[utoipa::path(post,- path = "/v2/payments/recovery",+ path = "/v2/recovery",params(("X-Profile-Id" = String, Header,diff --git a/crates/router/src/lib.rs b/crates/router/src/lib.rsindex 091cbb34a9..427f1a4338 100644--- a/crates/router/src/lib.rs+++ b/crates/router/src/lib.rs@@ -358,7 +358,7 @@ pub fn mk_app(.service(routes::ProcessTrackerDeprecated::server(state.clone())).service(routes::ProcessTracker::server(state.clone())).service(routes::Gsm::server(state.clone()))- .service(routes::RecoveryDataBackfill::server(state.clone()))+ .service(routes::RevenueRecovery::server(state.clone())).service(routes::Analytics::server(state.clone()));}}diff --git a/crates/router/src/routes.rs b/crates/router/src/routes.rsindex d4059579bd..7a4be1125f 100644--- a/crates/router/src/routes.rs+++ b/crates/router/src/routes.rs@@ -111,7 +111,7 @@ pub use self::app::{#[cfg(feature = "payouts")]pub use self::app::{PayoutLink, Payouts};#[cfg(feature = "v2")]-pub use self::app::{RecoveryDataBackfill, Tokenization};+pub use self::app::{RevenueRecovery, Tokenization};#[cfg(all(feature = "stripe", feature = "v1"))]pub use super::compatibility::stripe::StripeApis;#[cfg(feature = "olap")]diff --git a/crates/router/src/routes/app.rs b/crates/router/src/routes/app.rsindex 638d7d7ec9..ff8482a00c 100644--- a/crates/router/src/routes/app.rs+++ b/crates/router/src/routes/app.rs@@ -874,6 +874,7 @@ impl Payments {.service(web::resource("/aggregate").route(web::get().to(payments::get_payments_aggregates)),)+ // TODO: Deprecated. Remove this in favour of /v2/recovery.service(web::resource("/recovery").route(web::post().to(payments::recovery_payments_create)),@@ -3534,38 +3535,40 @@ impl ProfileAcquirer {}#[cfg(feature = "v2")]-pub struct RecoveryDataBackfill;+pub struct RevenueRecovery;+#[cfg(feature = "v2")]-impl RecoveryDataBackfill {+impl RevenueRecovery {pub fn server(state: AppState) -> Scope {- web::scope("/v2/recovery/data-backfill")+ use super::{payments, revenue_recovery_data_backfill, revenue_recovery_redis};+ web::scope("/v2/recovery").app_data(web::Data::new(state))+ .service(web::resource("").route(web::post().to(payments::recovery_payments_create))).service(- web::resource("").route(- web::post()- .to(super::revenue_recovery_data_backfill::revenue_recovery_data_backfill),- ),+ web::scope("/data-backfill")+ .service(+ web::resource("").route(+ web::post()+ .to(revenue_recovery_data_backfill::revenue_recovery_data_backfill),+ ),+ )+ .service(+ web::resource("/status/{connector_cutomer_id}/{payment_intent_id}").route(+ web::post().to(+ revenue_recovery_data_backfill::revenue_recovery_data_backfill_status,+ ),+ ),+ )+ .service(web::resource("/redis-data/{connector_cutomer_id}").route(+ web::get().to(revenue_recovery_redis::get_revenue_recovery_redis_data),+ ))+ .service(web::resource("/update-token").route(web::put().to(+ revenue_recovery_data_backfill::update_revenue_recovery_additional_redis_data,+ )))+ .service(web::resource("/retry-stats").route(web::post().to(+ revenue_recovery_data_backfill::revenue_recovery_retry_stats_migration,+ ))),)- .service(web::resource("/status/{connector_cutomer_id}/{payment_intent_id}").route(- web::post().to(- super::revenue_recovery_data_backfill::revenue_recovery_data_backfill_status,- ),- ))- .service(web::resource("/redis-data/{connector_cutomer_id}").route(- web::get().to(- super::revenue_recovery_redis::get_revenue_recovery_redis_data,- ),- ))- .service(web::resource("/update-token").route(- web::put().to(- super::revenue_recovery_data_backfill::update_revenue_recovery_additional_redis_data,- ),- ))- .service(web::resource("/retry-stats").route(- web::post().to(- super::revenue_recovery_data_backfill::revenue_recovery_retry_stats_migration,- ),- ))}}