Browse Source

update

master
alan 3 days ago
parent
commit
2b2286576f
  1. 4
      config.py
  2. 0
      logs/plutus_detailed.log.5
  3. 58
      repositories/payment_repository.py

4
config.py

@ -36,8 +36,8 @@ class Config:
MODE = 'payintent'
# Threading configuration
MAX_PAYMENT_THREADS = 15 # Number of concurrent payment processing threads
THREAD_TIMEOUT = 30 # Timeout in seconds for payment processing threads
MAX_PAYMENT_THREADS = 6 # Number of concurrent payment processing threads
THREAD_TIMEOUT = 2 # Timeout in seconds for payment processing threads
# Stripe API Keys
STRIPE_LIVE_API_KEY = os.environ.get('STRIPE_LIVE_API_KEY') or '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'

0
logs/plutus_detailed.log.5

58
repositories/payment_repository.py

@ -354,6 +354,29 @@ class PaymentRepository:
placeholders = ','.join(['%s'] * len(payment_methods))
#query = f"""
#SELECT DISTINCT
# cb.customer_id,
# cb.deposit,
# cb.payment_method,
# pad.field_1 AS stripe_customer_id
#FROM customer_billing cb
#LEFT OUTER JOIN payment_account_data pad ON cb.customer_id = pad.customer_id
#WHERE cb.payment_method IN ({placeholders})
#AND cb.deposit < %s
#AND pad.field_1 IS NOT NULL
#AND NOT EXISTS (
# SELECT 1
# FROM invoices i
# WHERE i.customer_id = cb.customer_id
# AND i.status = 'pending'
#)
#GROUP BY cb.customer_id, cb.deposit, cb.payment_method, pad.field_1
#ORDER BY cb.payment_method ASC, cb.customer_id ASC
#LIMIT %s
#"""
###### Multi-month billing runs
query = f"""
SELECT DISTINCT
cb.customer_id,
@ -371,40 +394,17 @@ class PaymentRepository:
WHERE i.customer_id = cb.customer_id
AND i.status = 'pending'
)
AND EXISTS (
SELECT 1
FROM invoices i
WHERE i.customer_id = cb.customer_id
AND i.date_till <= '2026-06-19'
)
GROUP BY cb.customer_id, cb.deposit, cb.payment_method, pad.field_1
ORDER BY cb.payment_method ASC, cb.customer_id ASC
LIMIT %s
"""
###### Multi-month billing runs
#query = """
#SELECT DISTINCT
# cb.customer_id,
# cb.deposit,
# cb.payment_method,
# pad.field_1 AS stripe_customer_id
#FROM customer_billing cb
#LEFT OUTER JOIN payment_account_data pad ON cb.customer_id = pad.customer_id
#WHERE cb.payment_method = %s
#AND cb.deposit < %s
#AND pad.field_1 IS NOT NULL
#AND NOT EXISTS (
# SELECT 1
# FROM invoices i
# WHERE i.customer_id = cb.customer_id
# AND i.status = 'pending'
#)
#AND EXISTS (
# SELECT 1
# FROM invoices i
# WHERE i.customer_id = cb.customer_id
# AND i.date_till = '2026-01-20'
#)
#GROUP BY cb.customer_id, cb.deposit, cb.payment_method, pad.field_1
#ORDER BY cb.payment_method ASC, cb.customer_id ASC
#LIMIT %s
#"""
## Need to fix "date_till"
#####################

Loading…
Cancel
Save