Beispiel #1
0
def makro(request):
    form = WebToPayResponseForm(request.META['QUERY_STRING'])

    if not form.is_valid():
        return _respond_error(request, "Invalid form. (%s)" % form.errors)

    err = form.badly_authorizes()
    if err:
        return _respond_error(request, "Unauthorized transaction: %s" % err)

    # Form validated fine, we can try to "save" it --
    # get instance of WebToPayResponse
    try:
        resp_obj = form.save(commit=False)
    except Exception, e:
        return _respond_error(request, "Exception while processing (%s)" % e)
Beispiel #2
0
 def testSS2Fail(self):
     query2 = query.replace('FxVM5X7j2mg9w', 'FxVM5X7j2mg9w'.swapcase())
     form = WebToPayResponseForm(query2)
     self.assertFalse(form.check_ss2())
Beispiel #3
0
 def testSS1Fail(self):
     query2 = query.replace("c72cffd0345f55fef6595a86e5c7caa6", "bad")
     form = WebToPayResponseForm(query2)
     self.assertFalse(form.check_ss1())
Beispiel #4
0
 def testSS2(self):
     form = WebToPayResponseForm(query)
     self.assertTrue(form.check_ss2())
Beispiel #5
0
 def testSS2Fail(self):
     query2 = query.replace('FxVM5X7j2mg9w', 'FxVM5X7j2mg9w'.swapcase())
     form = WebToPayResponseForm(query2)
     self.assertFalse(form.check_ss2())
Beispiel #6
0
 def testSS1Fail(self):
     query2 = query.replace("c72cffd0345f55fef6595a86e5c7caa6", "bad")
     form = WebToPayResponseForm(query2)
     self.assertFalse(form.check_ss1())
Beispiel #7
0
 def testSS2(self):
     form = WebToPayResponseForm(query)
     self.assertTrue(form.check_ss2())