switch to polling for btcpay payment sessions because btcpay web hooks
are super duper slow
This commit is contained in:
@ -164,6 +164,17 @@ class DBModel:
|
||||
)
|
||||
self.connection.commit()
|
||||
|
||||
def list_payment_sessions_for_account(self, email):
|
||||
self.cursor.execute("""
|
||||
SELECT id, type, dollars, created
|
||||
FROM payment_sessions WHERE email = %s""",
|
||||
(email, )
|
||||
)
|
||||
return list(map(
|
||||
lambda x: dict(id=x[0], type=x[1], dollars=x[2], created=x[3]),
|
||||
self.cursor.fetchall()
|
||||
))
|
||||
|
||||
def consume_payment_session(self, payment_type, id, dollars):
|
||||
self.cursor.execute("SELECT email, dollars FROM payment_sessions WHERE id = %s AND type = %s", (id, payment_type))
|
||||
row = self.cursor.fetchone()
|
||||
|
Reference in New Issue
Block a user