Fix null order id handling in Razorpay webhook
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:
@@ -78,8 +78,8 @@ class RazorpayWebhookCapture(
|
||||
val paymentEntity = root.path("payload").path("payment").path("entity")
|
||||
val orderEntity = root.path("payload").path("order").path("entity")
|
||||
val paymentId = paymentEntity.path("id").asText(null)
|
||||
val orderId = paymentEntity.path("order_id").asText(null).ifBlank { null }
|
||||
?: orderEntity.path("id").asText(null)
|
||||
val orderId = paymentEntity.path("order_id").asText(null)?.takeIf { it.isNotBlank() }
|
||||
?: orderEntity.path("id").asText(null)?.takeIf { it.isNotBlank() }
|
||||
val status = paymentEntity.path("status").asText(null)
|
||||
val amountPaise = paymentEntity.path("amount").asLong(0)
|
||||
val currency = paymentEntity.path("currency").asText(property.currency)
|
||||
|
||||
Reference in New Issue
Block a user