Beispiel #1
0
    def get(self, request):
        """process the trade info returned from alipay and then redirect to
        the order view page if it's verified. Otherwise, redirect to
        """

        alipay = AliPayProvider()
        data = request.query_params

        if alipay.verify_notify(**data):
            # TODO: same as above

            return HttpResponseRedirect('')
        else:


            return HttpResponseRedirect('/')
Beispiel #2
0
    def post(self, request):
        """log the request first, and then process the cash flow response
        """
        alipay = AliPayProvider()  # special use, no param given, just call some method
        data = request.data

        if alipay.verify_notify(**data):
            # verify pass, TODO: do some process here ex. payment processing and logging

            return HttpResponse('success')
        else:
            # this request may be faked which made by cracker..
            pass


        return HttpResponse('fail')