Require keyId and keySecret together
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s

This commit is contained in:
androidlover5842
2026-02-01 10:35:56 +05:30
parent cc402067c7
commit 13a2eb8afd

View File

@@ -69,6 +69,11 @@ class RazorpaySettingsController(
}
val webhookSecret = request.webhookSecret?.trim()?.ifBlank { null }
val isTest = request.isTest
val hasKeyId = keyId != null
val hasKeySecret = keySecret != null
if (hasKeyId != hasKeySecret) {
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "keyId and keySecret must be provided together")
}
if (existing == null && (keyId == null || keySecret == null)) {
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "keyId/keySecret required")
}