From 13a2eb8afd2c4ae3667a0840d8861dad5e52869e Mon Sep 17 00:00:00 2001 From: androidlover5842 Date: Sun, 1 Feb 2026 10:35:56 +0530 Subject: [PATCH] Require keyId and keySecret together --- .../controller/RazorpaySettingsController.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main/kotlin/com/android/trisolarisserver/controller/RazorpaySettingsController.kt b/src/main/kotlin/com/android/trisolarisserver/controller/RazorpaySettingsController.kt index cbc2997..ac25f25 100644 --- a/src/main/kotlin/com/android/trisolarisserver/controller/RazorpaySettingsController.kt +++ b/src/main/kotlin/com/android/trisolarisserver/controller/RazorpaySettingsController.kt @@ -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") }