DEV Community

Cover image for Razorpay payment DJANGO
testacc127000
testacc127000

Posted on • Edited on

3 2

Razorpay payment DJANGO

Steps to integrate Razorpay

  • Setting up Razorpay account.

  • Storing API keys in settings.py

  • Installing Razorpay library.

  • Creating order using Razorpay API.

  • Creating order at backend and also creating Razorpay order.

    • Show template
    • render to payment.html
    • Get info of call back URL
    • Done with creating an order.
  • Making payment.

  • Handling payment success and failure.

    • Razorpay makes a post request
    • with the help of that handling success/failure
    • Done with payment.
    • Final checks for all platforms
    • Final checking

https://gist.github.com/Nishant127/ed0e02cfb0ae0da3fb82f17b21252ca4

def get_image_urls(cls, markdown):
        regex = r"!\[.?]\((https.*?)\)"
        urls = re.findall(regex, markdown)
        for url in urls:
            img_data = requests.get(url).content
            with tempfile.NamedTemporaryFile(suffix=".png") as image:
                image.write(img_data)
                upload_file_to_bucket(image.name)
                url = create_file_upload_url(image.name)
Enter fullscreen mode Exit fullscreen mode

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay