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(core): Allow JWT authentication for Payments Capture flow (#12761)

DEEPANSHU BANSAL9a5b6f22437a
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index 1fa8901101..fee50eae5d 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -1128,10 +1128,18 @@ pub async fn payments_capture(
None,
)
},
- &auth::HeaderAuth(auth::ApiKeyAuth {
- allow_connected_scope_operation: true,
- allow_platform_self_operation: false,
- }),
+ auth::auth_type(
+ &auth::HeaderAuth(auth::ApiKeyAuth {
+ allow_connected_scope_operation: true,
+ allow_platform_self_operation: false,
+ }),
+ &auth::JWTAuth {
+ permission: Permission::ProfilePaymentWrite,
+ allow_connected: true,
+ allow_platform: false,
+ },
+ req.headers(),
+ ),
locking_action,
))
.await