DEV Community

Cover image for Razorpay payment DJANGO
testacc127000
testacc127000

Posted on • Updated on

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.

  • Sorry, unable to save it. You might have moved your notion database to some other page, please take it back to the page where it was created.

  • 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

Top comments (0)