Replace PayU integration with Razorpay
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
All checks were successful
build-and-deploy / build-deploy (push) Successful in 33s
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
package com.android.trisolarisserver.config
|
||||
|
||||
import org.springframework.jdbc.core.JdbcTemplate
|
||||
import org.springframework.stereotype.Component
|
||||
|
||||
@Component
|
||||
class RazorpayQrRequestSchemaFix(
|
||||
private val jdbcTemplate: JdbcTemplate
|
||||
) : PostgresSchemaFix(jdbcTemplate) {
|
||||
|
||||
override fun runPostgres(jdbcTemplate: JdbcTemplate) {
|
||||
val hasTable = jdbcTemplate.queryForObject(
|
||||
"""
|
||||
select count(*)
|
||||
from information_schema.tables
|
||||
where table_name = 'razorpay_qr_request'
|
||||
""".trimIndent(),
|
||||
Int::class.java
|
||||
) ?: 0
|
||||
if (hasTable == 0) {
|
||||
logger.info("Creating razorpay_qr_request table")
|
||||
jdbcTemplate.execute(
|
||||
"""
|
||||
create table razorpay_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,
|
||||
qr_id varchar,
|
||||
amount bigint not null,
|
||||
currency varchar not null,
|
||||
status varchar not null,
|
||||
image_url text,
|
||||
request_payload text,
|
||||
response_payload text,
|
||||
expiry_at timestamptz,
|
||||
created_at timestamptz not null
|
||||
)
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user