Skip to content

Commit

Permalink
chore: refactored the route to payment_methods prefixed routes
Browse files Browse the repository at this point in the history
  • Loading branch information
prajjwalkumar17 committed Jan 2, 2024
1 parent ec5368a commit 1c7a629
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 25 deletions.
1 change: 0 additions & 1 deletion crates/router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ pub fn mk_app(
.service(routes::Customers::server(state.clone()))
.service(routes::Configs::server(state.clone()))
.service(routes::Forex::server(state.clone()))
.service(routes::PmBlacklist::server(state.clone()))
.service(routes::Refunds::server(state.clone()))
.service(routes::MerchantConnectorAccount::server(state.clone()))
.service(routes::Mandates::server(state.clone()))
Expand Down
2 changes: 0 additions & 2 deletions crates/router/src/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ pub use self::app::DummyConnector;
pub use self::app::Forex;
#[cfg(feature = "payouts")]
pub use self::app::Payouts;
#[cfg(any(feature = "olap", feature = "oltp"))]
pub use self::app::PmBlacklist;
#[cfg(feature = "olap")]
pub use self::app::Routing;
#[cfg(all(feature = "olap", feature = "kms"))]
Expand Down
25 changes: 3 additions & 22 deletions crates/router/src/routes/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -395,28 +395,6 @@ impl Forex {
}
}

#[cfg(any(feature = "olap", feature = "oltp"))]
pub struct PmBlacklist;

#[cfg(any(feature = "olap", feature = "oltp"))]
impl PmBlacklist {
pub fn server(state: AppState) -> Scope {
web::scope("/pm")
.app_data(web::Data::new(state.clone()))
.service(
web::resource("/block").route(web::post().to(pm_blacklist::block_payment_method)),
)
.service(
web::resource("/unblock")
.route(web::post().to(pm_blacklist::unblock_payment_method)),
)
.service(
web::resource("/blocklist")
.route(web::get().to(pm_blacklist::list_blocked_payment_methods)),
)
}
}

#[cfg(feature = "olap")]
pub struct Routing;

Expand Down Expand Up @@ -578,6 +556,9 @@ impl PaymentMethods {
.route(web::post().to(create_payment_method_api))
.route(web::get().to(list_payment_method_api)), // TODO : added for sdk compatibility for now, need to deprecate this later
)
.service(web::resource("/block").route(web::post().to(pm_blacklist::block_payment_method)))
.service(web::resource("/unblock").route(web::post().to(pm_blacklist::unblock_payment_method)))
.service(web::resource("/blocklist").route(web::get().to(pm_blacklist::list_blocked_payment_methods)))
.service(
web::resource("/{payment_method_id}")
.route(web::get().to(payment_method_retrieve_api))
Expand Down

0 comments on commit 1c7a629

Please sign in to comment.