DEV Community

Paytm Payment Gateway Integration in Django

Ashutosh Chauhan on February 02, 2020

Paytm Payment Gateway Integration in Django Synopsis: This is a great way to learn how to integrate payments in your Django application....
Collapse
 
anandvmclt profile image
Anand

Thanks for this article.it worked for me. But it should have some small corrections.
1.) in step -1 "pay.html" make it Form method = POST.
2.) in step- 4 change " transaction = Transaction.objects.create(made_by=user, amount=20000)" shoud be change to amount = amount.
3.) on Step -6 , call back view has to add any HTTP responce.
# Like This
if is_valid_checksum:
received_data['message'] = "Checksum Matched"
return render(request, 'payments/callback.html', context=received_data)

    else:
Enter fullscreen mode Exit fullscreen mode
Collapse
 
devshree07 profile image
Devshree Patel

This post really helped me. Thank you for sharing! keep it up!

Collapse
 
raj1503 profile image
Raj1503

I am getting error MID
invalid: This MID is not available on our staging environment

Collapse
 
rajatsaxena14 profile image
rajat-saxena14

have you solved this problem? If yes, then please assist.

Collapse
 
akshayneje2823 profile image
Akshay Neje

I am facing the same issue can you please help me

Thread Thread
 
scofieldidehen profile image
Scofield Idehen

What is your issue, can you send me a repo to help you?

Thread Thread
 
akshayneje2823 profile image
Akshay Neje • Edited

I was integrating paytm payment getway for our MERN app
and got this error MID
invalid: This MID is not available on our staging environment.

can you please guide if have you solved this issue

Collapse
 
swapnilchand profile image
Swapnil Chand

Create a directory templates in the project's root directory and another directory registration in templates. Now add a file login.html in the registration directory and add the following to it.

Can someone say what is the meaning of preojects root directory in the above lines??

Collapse
 
kartavya profile image
Kartavya • Edited

[ModuleNotFoundError: No module named 'Crypto' ] this error comes while run server. I install Crypto module using pip. but It's not working. please give solution for this error.

Collapse
 
sandy_codes_py profile image
Santhosh (sandy inspires)

pip install paytmchecksum
instead of using the deprecated library pycrypto

Collapse
 
nileshmeharkar profile image
Nilesh-Meharkar

Please install pycryptodome

pip install pycryptodome

Collapse
 
syedameenuddin profile image
Syed Ameenuddin • Edited

try installing this
pip install pycryptodome

Collapse
 
venkateshkb profile image
Venkatesh Balasubramanian

Anybody tried it?? Is that working??

Collapse
 
sandy_codes_py profile image
Santhosh (sandy inspires)

yup!! works for me

Collapse
 
raj1503 profile image
Raj1503

in my case not working

Collapse
 
samankapur profile image
SamanKapur

Quick update - WhenThen provides a single SDK to access all your payment processors. They aim to reduce implementation headaches by doing a single integration once. Check it out here: documentation.whenthen.com/checkout

Collapse
 
rajatsainisim profile image
rajatsainisim

This post really helped me.

Collapse
 
apoorvashukla profile image
Apoorva Kumar Shukla
Collapse
 
apoorvashukla profile image
Apoorva Kumar Shukla

Great

Collapse
 
raj1503 profile image
Raj1503

sir i am getting Valuel error at /pay/ is incorrect AES key length..please help me