Only send payment link return URLs when provided
All checks were successful
build-and-deploy / build-deploy (push) Successful in 37s

This commit is contained in:
androidlover5842
2026-01-30 08:50:19 +05:30
parent 238b4f39f3
commit e37ba34fe2

View File

@@ -107,10 +107,8 @@ class PayuPaymentLinksController(
"viaEmail" to (request.viaEmail ?: false),
"viaSms" to (request.viaSms ?: false)
)
body["successURL"] = request.successUrl?.trim()?.ifBlank { null }
?: buildReturnUrl(propertyId, true)
body["failureURL"] = request.failureUrl?.trim()?.ifBlank { null }
?: buildReturnUrl(propertyId, false)
request.successUrl?.trim()?.ifBlank { null }?.let { body["successURL"] = it }
request.failureUrl?.trim()?.ifBlank { null }?.let { body["failureURL"] = it }
if (amountLong != null) {
body["subAmount"] = amountLong
}
@@ -216,10 +214,6 @@ class PayuPaymentLinksController(
}
}
private fun buildReturnUrl(propertyId: UUID, success: Boolean): String {
val path = if (success) "success" else "failure"
return "https://api.hoteltrisolaris.in/properties/$propertyId/payu/return/$path"
}
private fun computeExpectedPay(stays: List<com.android.trisolarisserver.models.room.RoomStay>, timezone: String?): Long {
if (stays.isEmpty()) return 0