Skip to content

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

feat(auth): enable MerchantIdAuth for v2 payments retrieve by merchant reference ID (#11077)

Aishwariyaa Anand6fe246cc05b5
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index 09c68ed9fb..8f8158c259 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -3568,6 +3568,16 @@ pub async fn payment_get_intent_using_merchant_reference_id(
let merchant_reference_id = path.into_inner();
+ let auth_type: &dyn auth::AuthenticateAndFetch<_, _> =
+ if state.conf.merchant_id_auth.merchant_id_auth_enabled {
+ &auth::MerchantIdAuth
+ } else {
+ &auth::V2ApiKeyAuth {
+ allow_connected_scope_operation: false,
+ allow_platform_self_operation: false,
+ }
+ };
+
Box::pin(api::server_wrap(
flow,
state,
@@ -3584,10 +3594,7 @@ pub async fn payment_get_intent_using_merchant_reference_id(
))
.await
},
- &auth::V2ApiKeyAuth {
- allow_connected_scope_operation: false,
- allow_platform_self_operation: false,
- },
+ auth_type,
api_locking::LockAction::NotApplicable,
))
.await