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),
|
||||
"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
|
||||
|
||||
Reference in New Issue
Block a user