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") }