Emit booking and QR events on payment capture
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 35s
This commit is contained in:
@@ -6,6 +6,7 @@ import com.android.trisolarisserver.models.booking.PaymentMethod
|
||||
import com.android.trisolarisserver.models.payment.RazorpayPaymentAttempt
|
||||
import com.android.trisolarisserver.models.payment.RazorpayWebhookLog
|
||||
import com.android.trisolarisserver.component.RazorpayQrEvents
|
||||
import com.android.trisolarisserver.component.BookingEvents
|
||||
import com.android.trisolarisserver.controller.dto.RazorpayQrEventResponse
|
||||
import com.android.trisolarisserver.repo.PaymentRepo
|
||||
import com.android.trisolarisserver.repo.PropertyRepo
|
||||
@@ -40,6 +41,7 @@ class RazorpayWebhookCapture(
|
||||
private val razorpayQrRequestRepo: RazorpayQrRequestRepo,
|
||||
private val razorpayWebhookLogRepo: RazorpayWebhookLogRepo,
|
||||
private val razorpayQrEvents: RazorpayQrEvents,
|
||||
private val bookingEvents: BookingEvents,
|
||||
private val objectMapper: ObjectMapper
|
||||
) {
|
||||
|
||||
@@ -153,6 +155,19 @@ class RazorpayWebhookCapture(
|
||||
receivedAt = OffsetDateTime.now()
|
||||
)
|
||||
)
|
||||
bookingEvents.emit(propertyId, booking.id!!)
|
||||
if (qrId != null) {
|
||||
razorpayQrEvents.emit(
|
||||
propertyId,
|
||||
qrId,
|
||||
RazorpayQrEventResponse(
|
||||
event = event,
|
||||
qrId = qrId,
|
||||
status = qrStatus,
|
||||
receivedAt = OffsetDateTime.now().toString()
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
private fun verifySignature(payload: String, secret: String, signature: String): Boolean {
|
||||
|
||||
Reference in New Issue
Block a user