Issue:
Bug: [FEATURE] Refactor Stripe compatibility routes



### Feature Description

Use `web::resource` to specify the paths in [`/crates/router/src/compatibility/stripe/app.rs`](https://github.com/juspay/hyperswitch/blob/main/crates/router/src/compatibility/stripe/app.rs)

### Possible Implementation

Refer this file https://github.com/juspay/hyperswitch/blob/main/crates/router/src/routes/app.rs

### Have you spent some time to check if this feature request has been raised before?

- [X] I checked and didn't find similar issue

### Have you read the Contributing Guidelines?

- [X] I have read the [Contributing Guidelines](https://github.com/juspay/hyperswitch/blob/main/docs/CONTRIBUTING.md)

### Are you willing to submit a PR?

None

Pull request description:
## Type of Change
<!-- Put an `x` in the boxes that apply -->

- [ ] Bugfix
- [ ] New feature
- [x] Enhancement
- [x] Refactoring
- [ ] Dependency updates
- [ ] Documentation
- [ ] CI/CD

## Description
<!-- Describe your changes in detail -->
- fixes #961 

### Additional Changes

- [ ] This PR modifies the API contract
- [ ] This PR modifies the database schema
- [ ] This PR modifies application configuration/environment variables

<!-- 
Provide links to the files with corresponding changes.

Following are the paths where you can find config files:
1. `config`
2. `crates/router/src/configs`
3. `loadtest/config`
-->


## Motivation and Context
<!--
Why is this change required? What problem does it solve?
If it fixes an open issue, please link to the issue here.

If you don't have an issue, we'd recommend starting with one first so the PR
can focus on the implementation (unless its an obvious bug or documentation fix
that will have little conversation).
-->


## How did you test it?
<!--
Did you write an integration/unit/API test to verify the code changes?
Or did you test this change manually (provide relevant screenshots)?
-->
- run cargo check on the entire project
- format the code


## Checklist
<!-- Put an `x` in the boxes that apply -->

- [x] I formatted the code `cargo +nightly fmt --all`
- [x] I addressed lints thrown by `cargo clippy`
- [x] I reviewed submitted code
- [ ] I added unit tests for my changes where possible
- [ ] I added a [CHANGELOG](/CHANGELOG.md) entry if applicable


Testing:

- run cargo check on the entire project
- format the code

Patch:
diff --git a/crates/router/src/compatibility/stripe/app.rs b/crates/router/src/compatibility/stripe/app.rs
index 898ffc0aee2..24abb90b423 100644
--- a/crates/router/src/compatibility/stripe/app.rs
+++ b/crates/router/src/compatibility/stripe/app.rs
@@ -7,14 +7,34 @@ pub struct PaymentIntents;
 
 impl PaymentIntents {
     pub fn server(state: routes::AppState) -> Scope {
-        web::scope("/payment_intents")
-            .app_data(web::Data::new(state))
-            .service(payment_intents_retrieve_with_gateway_creds)
-            .service(payment_intents_create)
-            .service(payment_intents_retrieve)
-            .service(payment_intents_update)
-            .service(payment_intents_confirm)
-            .service(payment_intents_capture)
+        let mut route = web::scope("/payment_intents").app_data(web::Data::new(state));
+        #[cfg(feature = "olap")]
+        {
+            route = route.service(web::resource("/list").route(web::get().to(payment_intent_list)))
+        }
+        route = route
+            .service(web::resource("").route(web::post().to(payment_intents_create)))
+            .service(
+                web::resource("/sync")
+                    .route(web::post().to(payment_intents_retrieve_with_gateway_creds)),
+            )
+            .service(
+                web::resource("/{payment_id}")
+                    .route(web::get().to(payment_intents_retrieve))
+                    .route(web::post().to(payment_intents_update)),
+            )
+            .service(
+                web::resource("/{payment_id}/confirm")
+                    .route(web::post().to(payment_intents_confirm)),
+            )
+            .service(
+                web::resource("/{payment_id}/capture")
+                    .route(web::post().to(payment_intents_capture)),
+            )
+            .service(
+                web::resource("/{payment_id}/cancel").route(web::post().to(payment_intents_cancel)),
+            );
+        route
     }
 }
 
@@ -24,10 +44,15 @@ impl SetupIntents {
     pub fn server(state: routes::AppState) -> Scope {
         web::scope("/setup_intents")
             .app_data(web::Data::new(state))
-            .service(setup_intents_create)
-            .service(setup_intents_retrieve)
-            .service(setup_intents_update)
-            .service(setup_intents_confirm)
+            .service(web::resource("").route(web::post().to(setup_intents_create)))
+            .service(
+                web::resource("/{setup_id}")
+                    .route(web::get().to(setup_intents_retrieve))
+                    .route(web::post().to(setup_intents_update)),
+            )
+            .service(
+                web::resource("/{setup_id}/confirm").route(web::post().to(setup_intents_confirm)),
+            )
     }
 }
 
@@ -37,10 +62,15 @@ impl Refunds {
     pub fn server(config: routes::AppState) -> Scope {
         web::scope("/refunds")
             .app_data(web::Data::new(config))
-            .service(refund_create)
-            .service(refund_retrieve)
-            .service(refund_update)
-            .service(refund_retrieve_with_gateway_creds)
+            .service(web::resource("").route(web::post().to(refund_create)))
+            .service(
+                web::resource("/sync").route(web::post().to(refund_retrieve_with_gateway_creds)),
+            )
+            .service(
+                web::resource("/{refund_id}")
+                    .route(web::get().to(refund_retrieve))
+                    .route(web::post().to(refund_update)),
+            )
     }
 }
 
@@ -50,11 +80,17 @@ impl Customers {
     pub fn server(config: routes::AppState) -> Scope {
         web::scope("/customers")
             .app_data(web::Data::new(config))
-            .service(customer_create)
-            .service(customer_retrieve)
-            .service(customer_update)
-            .service(customer_delete)
-            .service(list_customer_payment_method_api)
+            .service(web::resource("").route(web::post().to(customer_create)))
+            .service(
+                web::resource("/{customer_id}")
+                    .route(web::get().to(customer_retrieve))
+                    .route(web::post().to(customer_update))
+                    .route(web::delete().to(customer_delete)),
+            )
+            .service(
+                web::resource("/{customer_id}/payment_methods")
+                    .route(web::get().to(list_customer_payment_method_api)),
+            )
     }
 }
 
diff --git a/crates/router/src/compatibility/stripe/customers.rs b/crates/router/src/compatibility/stripe/customers.rs
index b5c1b08b2a1..b96cdd33755 100644
--- a/crates/router/src/compatibility/stripe/customers.rs
+++ b/crates/router/src/compatibility/stripe/customers.rs
@@ -1,6 +1,6 @@
 pub mod types;
 
-use actix_web::{delete, get, post, web, HttpRequest, HttpResponse};
+use actix_web::{web, HttpRequest, HttpResponse};
 use error_stack::report;
 use router_env::{instrument, tracing};
 
@@ -13,7 +13,6 @@ use crate::{
 };
 
 #[instrument(skip_all)]
-#[post("")]
 pub async fn customer_create(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -51,7 +50,6 @@ pub async fn customer_create(
 }
 
 #[instrument(skip_all)]
-#[get("/{customer_id}")]
 pub async fn customer_retrieve(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
@@ -83,7 +81,6 @@ pub async fn customer_retrieve(
 }
 
 #[instrument(skip_all)]
-#[post("/{customer_id}")]
 pub async fn customer_update(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -124,7 +121,6 @@ pub async fn customer_update(
 }
 
 #[instrument(skip_all)]
-#[delete("/{customer_id}")]
 pub async fn customer_delete(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
@@ -154,7 +150,6 @@ pub async fn customer_delete(
 }
 
 #[instrument(skip_all)]
-#[get("/{customer_id}/payment_methods")]
 pub async fn list_customer_payment_method_api(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
diff --git a/crates/router/src/compatibility/stripe/payment_intents.rs b/crates/router/src/compatibility/stripe/payment_intents.rs
index f9f90b65523..f8d2b32c63a 100644
--- a/crates/router/src/compatibility/stripe/payment_intents.rs
+++ b/crates/router/src/compatibility/stripe/payment_intents.rs
@@ -1,6 +1,6 @@
 pub mod types;
 
-use actix_web::{get, post, web, HttpRequest, HttpResponse};
+use actix_web::{web, HttpRequest, HttpResponse};
 use api_models::payments as payment_types;
 use error_stack::report;
 use router_env::{instrument, tracing};
@@ -13,7 +13,6 @@ use crate::{
     types::api::{self as api_types},
 };
 
-#[post("")]
 #[instrument(skip_all)]
 pub async fn payment_intents_create(
     state: web::Data<routes::AppState>,
@@ -63,7 +62,6 @@ pub async fn payment_intents_create(
 }
 
 #[instrument(skip_all)]
-#[get("/{payment_id}")]
 pub async fn payment_intents_retrieve(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
@@ -112,7 +110,6 @@ pub async fn payment_intents_retrieve(
 }
 
 #[instrument(skip_all)]
-#[post("/sync")]
 pub async fn payment_intents_retrieve_with_gateway_creds(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -170,7 +167,6 @@ pub async fn payment_intents_retrieve_with_gateway_creds(
 }
 
 #[instrument(skip_all)]
-#[post("/{payment_id}")]
 pub async fn payment_intents_update(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -229,7 +225,6 @@ pub async fn payment_intents_update(
 }
 
 #[instrument(skip_all)]
-#[post("/{payment_id}/confirm")]
 pub async fn payment_intents_confirm(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -289,7 +284,6 @@ pub async fn payment_intents_confirm(
     .await
 }
 
-#[post("/{payment_id}/capture")]
 pub async fn payment_intents_capture(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -340,7 +334,6 @@ pub async fn payment_intents_capture(
 }
 
 #[instrument(skip_all)]
-#[post("/{payment_id}/cancel")]
 pub async fn payment_intents_cancel(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -395,7 +388,6 @@ pub async fn payment_intents_cancel(
 }
 
 #[instrument(skip_all)]
-#[get("/list")]
 #[cfg(feature = "olap")]
 pub async fn payment_intent_list(
     state: web::Data<routes::AppState>,
diff --git a/crates/router/src/compatibility/stripe/refunds.rs b/crates/router/src/compatibility/stripe/refunds.rs
index 644a50e5786..a42f31cc17a 100644
--- a/crates/router/src/compatibility/stripe/refunds.rs
+++ b/crates/router/src/compatibility/stripe/refunds.rs
@@ -1,6 +1,6 @@
 pub mod types;
 
-use actix_web::{get, post, web, HttpRequest, HttpResponse};
+use actix_web::{web, HttpRequest, HttpResponse};
 use error_stack::report;
 use router_env::{instrument, tracing};
 
@@ -13,7 +13,6 @@ use crate::{
 };
 
 #[instrument(skip_all)]
-#[post("")]
 pub async fn refund_create(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -50,7 +49,6 @@ pub async fn refund_create(
 }
 
 #[instrument(skip_all)]
-#[post("/sync")]
 pub async fn refund_retrieve_with_gateway_creds(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -91,7 +89,6 @@ pub async fn refund_retrieve_with_gateway_creds(
 }
 
 #[instrument(skip_all)]
-#[get("/{refund_id}")]
 pub async fn refund_retrieve(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
@@ -129,7 +126,6 @@ pub async fn refund_retrieve(
 }
 
 #[instrument(skip_all)]
-#[post("/{refund_id}")]
 pub async fn refund_update(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
diff --git a/crates/router/src/compatibility/stripe/setup_intents.rs b/crates/router/src/compatibility/stripe/setup_intents.rs
index fafe7db542e..b11be5b3465 100644
--- a/crates/router/src/compatibility/stripe/setup_intents.rs
+++ b/crates/router/src/compatibility/stripe/setup_intents.rs
@@ -1,6 +1,6 @@
 pub mod types;
 
-use actix_web::{get, post, web, HttpRequest, HttpResponse};
+use actix_web::{web, HttpRequest, HttpResponse};
 use api_models::payments as payment_types;
 use error_stack::report;
 use router_env::{instrument, tracing};
@@ -13,7 +13,6 @@ use crate::{
     types::api as api_types,
 };
 
-#[post("")]
 #[instrument(skip_all)]
 pub async fn setup_intents_create(
     state: web::Data<routes::AppState>,
@@ -60,7 +59,6 @@ pub async fn setup_intents_create(
 }
 
 #[instrument(skip_all)]
-#[get("/{setup_id}")]
 pub async fn setup_intents_retrieve(
     state: web::Data<routes::AppState>,
     req: HttpRequest,
@@ -109,7 +107,6 @@ pub async fn setup_intents_retrieve(
 }
 
 #[instrument(skip_all)]
-#[post("/{setup_id}")]
 pub async fn setup_intents_update(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,
@@ -165,7 +162,6 @@ pub async fn setup_intents_update(
 }
 
 #[instrument(skip_all)]
-#[post("/{setup_id}/confirm")]
 pub async fn setup_intents_confirm(
     state: web::Data<routes::AppState>,
     qs_config: web::Data<serde_qs::Config>,