Require keyId and keySecret together
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
This commit is contained in:
@@ -69,6 +69,11 @@ class RazorpaySettingsController(
|
|||||||
}
|
}
|
||||||
val webhookSecret = request.webhookSecret?.trim()?.ifBlank { null }
|
val webhookSecret = request.webhookSecret?.trim()?.ifBlank { null }
|
||||||
val isTest = request.isTest
|
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)) {
|
if (existing == null && (keyId == null || keySecret == null)) {
|
||||||
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "keyId/keySecret required")
|
throw ResponseStatusException(HttpStatus.BAD_REQUEST, "keyId/keySecret required")
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user