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 Void flow (#11899)

DEEPANSHU BANSAL24c4610c45d4
diff --git a/crates/router/src/routes/payments.rs b/crates/router/src/routes/payments.rs
index 2178d4ad6e..98949bcb44 100644
--- a/crates/router/src/routes/payments.rs
+++ b/crates/router/src/routes/payments.rs
@@ -1690,10 +1690,18 @@ pub async fn payments_cancel(
HeaderPayload::default(),
)
},
- &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