Releases: BuildWithHussain/razorpay_frappe
v1.4 Payment Links!
You can now create Payment Links right from the desk!
rzp_payment_links.mp4
- Both Standard & UPI type links
- Status is synced every hour
- Manual syncing using a button
- Copy link to clipboard
v1.3 Bug Fix
Full Changelog: v1.2...v1.3
v1.2 Refactor Webhook Handler
Smaller things, simpler and more readable code: v1.1...v1.2
v1.1 - Workspace!
v1.0.0
Plug-n-play Razorpay Integration for your Frappe apps and sites.
Configuration
Open up Razorpay Settings
and add your API keys:
You can also toggle guest checkout from here. If you disable guest checkout, the API endpoints for working with Razorpay orders (more soon) will need authentication.
Accepting Payments / Checkout from Frontend
CleanShot.2024-05-13.at.13.15.59.mp4
The backend is already ready ⚡. For the frontend, I have included 2 ready to go examples:
The nice thing about the second example is that you can just copy the RazorpayHeadlessCheckout
(source) component to your FrappeUI based frontend and it will just work!
All of the payment tracking happens in the Razorpay Order
DocType:
You can hook into document lifecycle events (before_insert
, on_update
, etc.) of this DocType to extend/add your own logic. Here is an example using doc_events
hook in our custom app:
# hooks.py
#--------
doc_events = {
"Razorpay Order": {
"on_update": "path.to.method.process_payment_update"
}
}
# method
def process_payment_update(doc, event):
if doc.has_value_changed("status") and doc.status == "Paid":
meta_data = frappe.parse_json(doc.meta_data)
# create tickets, sales invoice, etc.
# ...
You can do the same thing using Server Script
(Document Event) as well.