implement content-security-policy, static assets cache bust, and fix
stripe back button ratchet issue because the only way to use stripe checkout is to run their proprietary JS, and we arent using a SPA, naturally what happens is, when you land on the stripe payment page if you hit the back button it goes back to the same page where you got re-directed to stripe. this commit fixes that.
This commit is contained in:
@ -175,6 +175,21 @@ class DBModel:
|
||||
self.cursor.fetchall()
|
||||
))
|
||||
|
||||
def payment_session_redirect(self, email, id):
|
||||
self.cursor.execute("SELECT redirected FROM payment_sessions WHERE email = %s AND id = %s",
|
||||
(email, id)
|
||||
)
|
||||
row = self.cursor.fetchone()
|
||||
if row:
|
||||
self.cursor.execute("UPDATE payment_sessions SET redirected = TRUE WHERE email = %s AND id = %s",
|
||||
(email, id)
|
||||
)
|
||||
self.connection.commit()
|
||||
return row[0]
|
||||
|
||||
return None
|
||||
|
||||
|
||||
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