diff --git a/printrov_merch_store/api.py b/printrov_merch_store/api.py new file mode 100644 index 0000000..f41f775 --- /dev/null +++ b/printrov_merch_store/api.py @@ -0,0 +1,24 @@ +import frappe +import razorpay + + +@frappe.whitelist() +def handle_checkout_submit(product_name: str, order_details): + # Get the razorpay client + # razorpay_client = get_razorpay_client() + + # razorpay_order = razorpay_client.order.create({ + # "amount": 100, + # "currency": "INR", + # }) + print(order_details) + + +def get_razorpay_client(): + razorpay_settings = frappe.get_cached_doc( + "Printrove Razorpay Settings" + ) + key_id = razorpay_settings.key_id + key_secret = razorpay_settings.get_password("key_secret") + + return razorpay.Client(auth=(key_id, key_secret)) diff --git a/printrov_merch_store/www/checkout.html b/printrov_merch_store/www/checkout.html index fe6e953..0dc77f8 100644 --- a/printrov_merch_store/www/checkout.html +++ b/printrov_merch_store/www/checkout.html @@ -1 +1,87 @@ +{% extends "templates/web.html" %} + +{% block script %} + + +{% endblock %} + +{% block page_content %}