Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
aisbf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexlab
aisbf
Commits
1ed05114
Commit
1ed05114
authored
Apr 16, 2026
by
Your Name
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(payments): use database-agnostic placeholders in PaymentService
parent
b70c5596
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
service.py
aisbf/payments/service.py
+11
-8
No files found.
aisbf/payments/service.py
View file @
1ed05114
...
...
@@ -34,10 +34,11 @@ class PaymentService:
# Get enabled crypto types
with
self
.
db
.
_get_connection
()
as
conn
:
cursor
=
conn
.
cursor
()
cursor
.
execute
(
"""
placeholder
=
'?'
if
self
.
db
.
db_type
==
'sqlite'
else
'
%
s'
cursor
.
execute
(
f
"""
SELECT crypto_type FROM crypto_consolidation_settings
WHERE enabled =
TRUE
"""
)
WHERE enabled =
{placeholder}
"""
,
(
True
,)
)
enabled_cryptos
=
cursor
.
fetchall
()
for
crypto_config
in
enabled_cryptos
:
...
...
@@ -54,10 +55,11 @@ class PaymentService:
"""Get user's crypto wallet balances"""
with
self
.
db
.
_get_connection
()
as
conn
:
cursor
=
conn
.
cursor
()
cursor
.
execute
(
"""
placeholder
=
'?'
if
self
.
db
.
db_type
==
'sqlite'
else
'
%
s'
cursor
.
execute
(
f
"""
SELECT crypto_type, balance_crypto, balance_fiat, last_updated
FROM user_crypto_wallets
WHERE user_id =
?
WHERE user_id =
{placeholder}
"""
,
(
user_id
,))
wallets
=
cursor
.
fetchall
()
...
...
@@ -82,11 +84,12 @@ class PaymentService:
# Create payment method entry
with
self
.
db
.
_get_connection
()
as
conn
:
cursor
=
conn
.
cursor
()
cursor
.
execute
(
"""
placeholder
=
'?'
if
self
.
db
.
db_type
==
'sqlite'
else
'
%
s'
cursor
.
execute
(
f
"""
INSERT INTO payment_methods
(user_id, type, gateway, crypto_type, is_default, status)
VALUES (
?, 'crypto', ?, ?, TRUE
, 'active')
"""
,
(
user_id
,
crypto_type
,
crypto_type
))
VALUES (
{placeholder}, 'crypto', {placeholder}, {placeholder}, {placeholder}
, 'active')
"""
,
(
user_id
,
crypto_type
,
crypto_type
,
True
))
conn
.
commit
()
return
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment