Only send payment link return URLs when provided
All checks were successful
build-and-deploy / build-deploy (push) Successful in 37s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 37s
This commit is contained in:
@@ -107,10 +107,8 @@ class PayuPaymentLinksController(
|
|||||||
"viaEmail" to (request.viaEmail ?: false),
|
"viaEmail" to (request.viaEmail ?: false),
|
||||||
"viaSms" to (request.viaSms ?: false)
|
"viaSms" to (request.viaSms ?: false)
|
||||||
)
|
)
|
||||||
body["successURL"] = request.successUrl?.trim()?.ifBlank { null }
|
request.successUrl?.trim()?.ifBlank { null }?.let { body["successURL"] = it }
|
||||||
?: buildReturnUrl(propertyId, true)
|
request.failureUrl?.trim()?.ifBlank { null }?.let { body["failureURL"] = it }
|
||||||
body["failureURL"] = request.failureUrl?.trim()?.ifBlank { null }
|
|
||||||
?: buildReturnUrl(propertyId, false)
|
|
||||||
if (amountLong != null) {
|
if (amountLong != null) {
|
||||||
body["subAmount"] = amountLong
|
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 {
|
private fun computeExpectedPay(stays: List<com.android.trisolarisserver.models.room.RoomStay>, timezone: String?): Long {
|
||||||
if (stays.isEmpty()) return 0
|
if (stays.isEmpty()) return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user