Alert Tanner when an IPN fails to verify

This commit is contained in:
Tanner Collin 2020-07-03 23:03:00 +00:00
parent 2a381402e2
commit f3d96b4019
2 changed files with 10 additions and 0 deletions

View File

@ -30,6 +30,14 @@ STATIC_FOLDER = 'data/static/'
def today_alberta_tz():
return datetime.now(pytz.timezone('America/Edmonton')).date()
def alert_tanner(message):
try:
logger.info('Alerting Tanner: ' + message)
params = dict(spaceport=message)
requests.get('https://tbot.tannercollin.com/message', params=params, timeout=4)
except BaseException as e:
logger.error('Problem alerting Tanner: ' + str(e))
def num_months_spanned(d1, d2):
'''
Return number of month thresholds two dates span.

View File

@ -102,6 +102,8 @@ def verify_paypal_ipn(data):
except BaseException as e:
logger.error('IPN verify - {} - {}'.format(e.__class__.__name__, str(e)))
utils.alert_tanner('IPN failed to verify:\n\n' + str(data.dict()))
return False
def build_tx(data):