Ejemplo n.º 1
0
def payment(request):
    MERCHANT_KEY = settings.PAYTM_MERCHANT_KEY
    MERCHANT_ID = settings.PAYTM_MERCHANT_ID
    get_lang = "/" + get_language() if get_language() else ''
    CALLBACK_URL = settings.HOST_URL + get_lang + settings.PAYTM_CALLBACK_URL
    # Generating unique temporary ids
    order_id = Checksum.__id_generator__()

    bill_amount = request.GET.get("bill_amount")
    if bill_amount:
        data_dict = {
            'MID': MERCHANT_ID,
            'ORDER_ID': order_id,
            'TXN_AMOUNT': bill_amount,
            'CUST_ID': '*****@*****.**',
            'INDUSTRY_TYPE_ID': 'Retail',
            'WEBSITE': 'WEB_STAGING',
            'CHANNEL_ID': 'WEB',
            'CALLBACK_URL': CALLBACK_URL,
        }
        param_dict = data_dict
        param_dict['CHECKSUMHASH'] = Checksum.generate_checksum(
            data_dict, MERCHANT_KEY)
        return render(request, "paytm/payment.html", {'paytmdict': param_dict})
    return HttpResponse("Bill Amount Could not find. ?bill_amount=10")
Ejemplo n.º 2
0
def paytm_request(request, token):

    teamcaptain = TeamCaptain.objects.get(payment_token=token)

    MERCHANT_KEY = settings.PAYTM_MERCHANT_KEY
    MERCHANT_ID = settings.PAYTM_MERCHANT_ID
    CALLBACK_URL = settings.HOST_URL + settings.PAYTM_CALLBACK_URL
    # Generating unique temporary ids
    order_id = Checksum.__id_generator__()
    teamcaptain.order_id = order_id
    teamcaptain.save()
    bill_amount = teamcaptain.event.price
    name = str(teamcaptain.name) + ' ' + str(teamcaptain.event.name)
    if bill_amount:

        data_dict = {
            'MID': MERCHANT_ID,
            'ORDER_ID': order_id,
            'TXN_AMOUNT': bill_amount,
            'CUST_ID': 'Cust002',
            'INDUSTRY_TYPE_ID': 'Retail',
            'WEBSITE': 'DIYtestingweb',  #testing phase
            'CHANNEL_ID': 'WEB',
            'CALLBACK_URL': CALLBACK_URL,
        }
        param_dict = data_dict
        param_dict['CHECKSUMHASH'] = Checksum.generate_checksum(
            data_dict, MERCHANT_KEY)
        print param_dict
        return render(request, "registrations/payment.html",
                      {'paytmdict': param_dict})
    return HttpResponse("Bill Amount Error.")
Ejemplo n.º 3
0
def payment(request):
    MERCHANT_KEY = settings.PAYTM_MERCHANT_KEY
    MERCHANT_ID = settings.PAYTM_MERCHANT_ID
    CALLBACK_URL = settings.PAYTM_CALLBACK_URL

    # Generating unique temporary ids
    order_id = Checksum.__id_generator__()

    bill_amount = "100"
    data_dict = {
        'MID': MERCHANT_ID,
        'ORDER_ID': order_id,
        'TXN_AMOUNT': bill_amount,
        'CUST_ID': '*****@*****.**',
        'INDUSTRY_TYPE_ID': 'Retail',
        'WEBSITE': 'WEB_STAGING',
        'CHANNEL_ID': 'WEB',
        'CALLBACK_URL': CALLBACK_URL,
    }
    param_dict = data_dict
    param_dict['CHECKSUMHASH'] = Checksum.generate_checksum(
        data_dict, MERCHANT_KEY)
    return render(request, "payment.html", {'paytmdict': param_dict})