Пример #1
0
def handlerequest(request):
    #paytm will send post request here
    form = request.POST
    response_dict = {}
    for i in form.keys():
        response_dict[i] = form[i]
        if i == 'CHECKSUMHASH':
            checksum = form[i]

    verify = Checksum.verify_checksum(response_dict, MERCHANT_KEY, checksum)
    if verify:
        response_dict['RESPCODE'] = '01'
        # if response_dict['RESPCODE'] == '01':
        print('order successful')
        tutor_email = response_dict['ORDERID'].split('@@')[2]
        subjects = response_dict['ORDERID'].split('@@')[1]
        student_email = response_dict['ORDERID'].split('@@')[3]
        studentRequestPendingPayment.objects.filter(
            studentEmailId=student_email,
            tutorEmailId=tutor_email,
            subject=subjects).delete()
        studentTutorRelation.objects.create(studentEmailId=student_email,
                                            tutorEmailId=tutor_email,
                                            subject=subjects)
        tutorStudentRelation.objects.create(tutorEmailId=tutor_email,
                                            studentEmailId=student_email,
                                            subject=subjects)
        studentRequestFulfilled.objects.create(studentEmailId=student_email,
                                               tutorEmailId=tutor_email,
                                               subject=subjects)
        # else:
        # print('order was not successful because' + response_dict['RESPMSG'])
    return render(request, 'paymentstatus.html', {'response': response_dict})
Пример #2
0
def handlerequest(request):
    #paytm will send post request
    form = request.POST
    response_dict = {}
    for i in form.keys():
        response_dict[i] = form[i]
        if i == 'CHECKSUMHASH':
            checksum = form[i]
    verify = Checksum.verify_checksum(response_dict, MERCHANT_KEY, checksum)
    if verify:
        if response_dict['RESPCODE'] == '01':
            print('order successful')
        else:
            print('order was not successful because' +
                  response_dict['RESPMSG'])
    print(response_dict['BANKNAME'])
    bank_name = response_dict['BANKNAME']
    order_id = response_dict['ORDERID']
    transaction_id = response_dict['TXNID']
    gateway = response_dict['GATEWAYNAME']
    context = {
        'order_id': order_id,
        'bank_name': bank_name,
        'transaction_id': transaction_id,
        'gateway': gateway,
        'amount': response_dict['TXNAMOUNT']
    }
    return render(request, 'GymPages/paymentstatus.html', {
        'response': response_dict,
        'context': context
    })
Пример #3
0
def handlerequest(request):
    form = request.POST
    response_dict = {}
    for i in form.keys():
        response_dict[i] = form[i]
        if i == 'CHECKSUMHASH':
            checksum = form[i]

    verify = Checksum.verify_checksum(response_dict, MERCHANT_KEY, checksum)
    if verify:
        if response_dict['RESPCODE'] == '01':
            print('order successful')
        else:
            print('order was not successful because' +
                  response_dict['RESPMSG'])
    return render(request, 'home/paymentstatus.html',
                  {'response': response_dict})
Пример #4
0
def handlerequest(request):
    #paytm will send you post request here
    form=request.POST
    resposepaytm_dict={}
    for i in form:
        resposepaytm_dict[i]=form[i]
        if i=='CHECKSUMHASH':
            checksum=form[i]

    verify=Checksum.verify_checksum(resposepaytm_dict,MERCHANT_key,checksum)
    if verify:
        if resposepaytm_dict['RESPCODE']=='01':
            print("THANKS FOR SHOP WITH US YOUR ORDER IS SUCESSFULLY PLACED")
        else:
            print("failure during payment"+resposepaytm_dict['RESPMSG'])

    return render(request,'shop/paymentstatus.html',{'response':resposepaytm_dict})