diff --git a/backend/src/routes/deposit.ts b/backend/src/routes/deposit.ts index 995fe06..3af1029 100644 --- a/backend/src/routes/deposit.ts +++ b/backend/src/routes/deposit.ts @@ -767,6 +767,13 @@ ${refund > 0 && (!items || items.length === 0) ? `

Ос if (bRows[0]) { broadcast(ob.slug, { type: 'booking:updated', booking: bRows[0] }) } + // Insert payment record so the payment tab shows the amount + await db.query( + `INSERT INTO booking_payments (hotel_id, booking_id, amount, method, note) + VALUES ($1, $2, $3, 'yookassa', 'Оплата через ЮКассу (онлайн-бронирование)') + ON CONFLICT DO NOTHING`, + [ob.hotel_id, ob.booking_id, ob.total_amount], + ).catch(() => {}) } if (ob.guest_email) { sendBookingConfirmedEmail({