From d5118cc91faa81d48aa562b2ccd1385c88695240 Mon Sep 17 00:00:00 2001 From: Jannat Patel Date: Thu, 14 Dec 2023 16:08:07 +0530 Subject: [PATCH] fix: razorpay payment in other currency --- lms/lms/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lms/lms/utils.py b/lms/lms/utils.py index c8f84425..3f5ec9f5 100644 --- a/lms/lms/utils.py +++ b/lms/lms/utils.py @@ -920,7 +920,7 @@ def get_payment_options(doctype, docname, phone, country): "name": frappe.db.get_single_value("Website Settings", "app_name"), "description": _("Payment for {0} course").format(details["title"]), "order_id": order["id"], - "amount": order["amount"] * 100, + "amount": cint(order["amount"]) * 100, "currency": order["currency"], "prefill": { "name": frappe.db.get_value("User", frappe.session.user, "full_name"), @@ -1034,15 +1034,15 @@ def create_order(client, amount, currency): try: return client.order.create( { - "amount": amount, + "amount": cint(amount) * 100, "currency": currency, } ) except Exception as e: frappe.throw( _( - "Error during payment: {0} Please contact the Administrator. Amount {1} Currency {2}" - ).format(e, amount, currency) + "Error during payment: {0} Please contact the Administrator. Amount {1} Currency {2} Formatted {3}" + ).format(e, amount, currency, cint(amount)) )