Change default confirmation target to 1

This commit is contained in:
xmrcheckout
2026-01-08 17:39:58 +00:00
parent 90ade88057
commit 7bde17a3eb
4 changed files with 15 additions and 9 deletions
+8 -2
View File
@@ -180,10 +180,16 @@ def startup():
"ADD COLUMN IF NOT EXISTS subaddress_start_index INTEGER DEFAULT 0" "ADD COLUMN IF NOT EXISTS subaddress_start_index INTEGER DEFAULT 0"
) )
) )
connection.execute(
text(
"ALTER TABLE users "
"ADD COLUMN IF NOT EXISTS default_confirmation_target INTEGER DEFAULT 1"
)
)
connection.execute( connection.execute(
text( text(
"ALTER TABLE users " "ALTER TABLE users "
"ADD COLUMN IF NOT EXISTS default_confirmation_target INTEGER DEFAULT 2" "ALTER COLUMN default_confirmation_target SET DEFAULT 1"
) )
) )
connection.execute( connection.execute(
@@ -235,7 +241,7 @@ def startup():
) )
connection.execute( connection.execute(
text( text(
"UPDATE users SET default_confirmation_target = 2 " "UPDATE users SET default_confirmation_target = 1 "
"WHERE default_confirmation_target IS NULL" "WHERE default_confirmation_target IS NULL"
) )
) )
+1 -1
View File
@@ -125,7 +125,7 @@ class User(Base):
webhook_secret_encrypted = Column(String, nullable=True) webhook_secret_encrypted = Column(String, nullable=True)
next_subaddress_index = Column(Integer, nullable=False, server_default="1") next_subaddress_index = Column(Integer, nullable=False, server_default="1")
subaddress_start_index = Column(Integer, nullable=False, server_default="0") subaddress_start_index = Column(Integer, nullable=False, server_default="0")
default_confirmation_target = Column(Integer, nullable=False, server_default="2") default_confirmation_target = Column(Integer, nullable=False, server_default="1")
default_qr_logo = Column(String, nullable=False, server_default="monero") default_qr_logo = Column(String, nullable=False, server_default="monero")
default_qr_logo_data_url = Column(String, nullable=True) default_qr_logo_data_url = Column(String, nullable=True)
btcpay_checkout_style = Column(String, nullable=False, server_default="btcpay_classic") btcpay_checkout_style = Column(String, nullable=False, server_default="btcpay_classic")
+4 -4
View File
@@ -25,7 +25,7 @@ class InvoiceCreate(BaseModel):
amount_xmr: Decimal | None = Field(default=None, gt=0) amount_xmr: Decimal | None = Field(default=None, gt=0)
amount_fiat: Decimal | None = Field(default=None, gt=0) amount_fiat: Decimal | None = Field(default=None, gt=0)
currency: str | None = None currency: str | None = None
confirmation_target: conint(ge=0, le=10) = 2 confirmation_target: conint(ge=0, le=10) = 1
checkout_continue_url: AnyUrl | None = Field( checkout_continue_url: AnyUrl | None = Field(
default=None, default=None,
description="Optional: after the invoice is confirmed, the hosted invoice page can offer a Continue button that navigates to this merchant URL.", description="Optional: after the invoice is confirmed, the hosted invoice page can offer a Continue button that navigates to this merchant URL.",
@@ -67,7 +67,7 @@ class InvoiceCreate(BaseModel):
class DonationCreate(BaseModel): class DonationCreate(BaseModel):
amount_xmr: Decimal = Field(gt=0) amount_xmr: Decimal = Field(gt=0)
confirmation_target: conint(ge=0, le=10) = 2 confirmation_target: conint(ge=0, le=10) = 1
class InvoiceResponse(BaseModel): class InvoiceResponse(BaseModel):
@@ -104,7 +104,7 @@ class InvoiceCreateUser(BaseModel):
amount_xmr: Decimal | None = Field(default=None, gt=0) amount_xmr: Decimal | None = Field(default=None, gt=0)
amount_fiat: Decimal | None = Field(default=None, gt=0) amount_fiat: Decimal | None = Field(default=None, gt=0)
currency: str | None = None currency: str | None = None
confirmation_target: conint(ge=0, le=10) = 2 confirmation_target: conint(ge=0, le=10) = 1
checkout_continue_url: AnyUrl | None = Field( checkout_continue_url: AnyUrl | None = Field(
default=None, default=None,
description="Optional: after the invoice is confirmed, the hosted invoice page can offer a Continue button that navigates to this merchant URL.", description="Optional: after the invoice is confirmed, the hosted invoice page can offer a Continue button that navigates to this merchant URL.",
@@ -189,7 +189,7 @@ class ProfileResponse(BaseModel):
id: UUID id: UUID
payment_address: str payment_address: str
default_confirmation_target: conint(ge=0, le=10) = 2 default_confirmation_target: conint(ge=0, le=10) = 1
default_qr_logo: QrLogoMode = "monero" default_qr_logo: QrLogoMode = "monero"
default_qr_logo_data_url: str | None = None default_qr_logo_data_url: str | None = None
btcpay_checkout_style: BtcpayCheckoutStyle = "btcpay_classic" btcpay_checkout_style: BtcpayCheckoutStyle = "btcpay_classic"
+2 -2
View File
@@ -359,7 +359,7 @@ export default async function DashboardPage({
searchQuery={invoiceSearchQuery} searchQuery={invoiceSearchQuery}
sort={invoiceSort} sort={invoiceSort}
order={invoiceOrder} order={invoiceOrder}
defaultConfirmationTarget={profileData?.default_confirmation_target ?? 2} defaultConfirmationTarget={profileData?.default_confirmation_target ?? 1}
/> />
) : null} ) : null}
{activeTab === "profile" ? ( {activeTab === "profile" ? (
@@ -417,7 +417,7 @@ export default async function DashboardPage({
</div> </div>
<div className="rounded-2xl border border-stroke bg-white/70 p-6 shadow-soft"> <div className="rounded-2xl border border-stroke bg-white/70 p-6 shadow-soft">
<DefaultConfirmationTargetSection <DefaultConfirmationTargetSection
initialValue={profileData?.default_confirmation_target ?? 2} initialValue={profileData?.default_confirmation_target ?? 1}
/> />
</div> </div>
<div className="rounded-2xl border border-stroke bg-white/70 p-6 shadow-soft"> <div className="rounded-2xl border border-stroke bg-white/70 p-6 shadow-soft">