Store Razorpay test keys alongside live keys
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 34s
This commit is contained in:
@@ -26,9 +26,30 @@ class RazorpaySettings(
|
||||
@Column(name = "webhook_secret", columnDefinition = "text")
|
||||
var webhookSecret: String? = null,
|
||||
|
||||
@Column(name = "key_id_test", columnDefinition = "text")
|
||||
var keyIdTest: String? = null,
|
||||
|
||||
@Column(name = "key_secret_test", columnDefinition = "text")
|
||||
var keySecretTest: String? = null,
|
||||
|
||||
@Column(name = "webhook_secret_test", columnDefinition = "text")
|
||||
var webhookSecretTest: String? = null,
|
||||
|
||||
@Column(name = "is_test", nullable = false)
|
||||
var isTest: Boolean = false,
|
||||
|
||||
@Column(name = "updated_at", nullable = false, columnDefinition = "timestamptz")
|
||||
var updatedAt: OffsetDateTime = OffsetDateTime.now()
|
||||
)
|
||||
) {
|
||||
fun resolveKeyId(): String? {
|
||||
return if (isTest) keyIdTest?.ifBlank { null } else keyId.ifBlank { null }
|
||||
}
|
||||
|
||||
fun resolveKeySecret(): String? {
|
||||
return if (isTest) keySecretTest?.ifBlank { null } else keySecret.ifBlank { null }
|
||||
}
|
||||
|
||||
fun resolveWebhookSecret(): String? {
|
||||
return if (isTest) webhookSecretTest?.ifBlank { null } else webhookSecret?.ifBlank { null }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user