Add PayU settings and dynamic QR generation
Some checks failed
build-and-deploy / build-deploy (push) Failing after 29s

This commit is contained in:
androidlover5842
2026-01-30 05:27:04 +05:30
parent 3a2afa264f
commit 38c0a0ec9a
9 changed files with 531 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
package com.android.trisolarisserver.config
import org.springframework.jdbc.core.JdbcTemplate
import org.springframework.stereotype.Component
@Component
class PayuQrRequestSchemaFix(
private val jdbcTemplate: JdbcTemplate
) : PostgresSchemaFix(jdbcTemplate) {
override fun runPostgres(jdbcTemplate: JdbcTemplate) {
val hasTable = jdbcTemplate.queryForObject(
"""
select count(*)
from information_schema.tables
where table_name = 'payu_qr_request'
""".trimIndent(),
Int::class.java
) ?: 0
if (hasTable == 0) {
logger.info("Creating payu_qr_request table")
jdbcTemplate.execute(
"""
create table payu_qr_request (
id uuid primary key,
property_id uuid not null references property(id) on delete cascade,
booking_id uuid not null references booking(id) on delete cascade,
txnid varchar not null,
amount bigint not null,
currency varchar not null,
status varchar not null,
request_payload text,
response_payload text,
created_at timestamptz not null
)
""".trimIndent()
)
}
}
}