diff --git a/erpnext/non_profit/doctype/membership/membership.py b/erpnext/non_profit/doctype/membership/membership.py
index 360c59f..574ae7f 100644
--- a/erpnext/non_profit/doctype/membership/membership.py
+++ b/erpnext/non_profit/doctype/membership/membership.py
@@ -3,6 +3,8 @@
 # For license information, please see license.txt
 
 from __future__ import unicode_literals
+import json
+from datetime import datetime
 import frappe
 from frappe.model.document import Document
 from frappe.utils import add_days, add_years, nowdate, getdate, add_months, cint
@@ -168,40 +170,91 @@
 
 	membership = create_membership(member, plan)
 
-	return membership.setup_subscription()
+	subscription = membership.setup_subscription()
+
+	membership.subscription_id = subscription.get('subscription_id')
+	membership.save(ignore_permissions=True)
+
+	return subscription
+
+def get_membership_based_on_subscription(subscription_id, custom_filters={}):
+	filters = {'subscription_id': subscription.id}
+	filters.update(custom_filters)
+
+	memberships = frappe.get_all("Membership", filters=filters, order_by="creation")
+	if not memberships:
+		return None
+
+	return frappe.get_doc("Membership", memberships[0]['name'])
+
 
 @frappe.whitelist(allow_guest=True)
-def razorpay_subscription_started(data={}):
-	data = {
-			"entity": "event",
-			"event": "subscription.activated",
-			"payload": {
-				"subscription": {
-					"entity": {
-						"id": "sub_EZZsbKwt5xRYH6",
-						"entity": "subscription",
-						"plan_id": "plan_EXwyxDYDCj3X4v",
-						"customer_id": "cust_EZZw80dUQgID8C",
-						"current_start": 1585822073,
-						"current_end": 1588357800,
-						"start_at": 1585822073,
-						"end_at": 1646159400,
-						"auth_attempts": 0,
-						"total_count": 24,
-						"paid_count": 1,
-					}
-				},
-				"payment": {
-					"entity": {
-						"id": "pay_EZZw7v9NEUFCVJ",
-						"amount": 10000,
-						"currency": "INR",
-						"method": "card",
-					}
-				}
-			},
-			"created_at": 1585822079
-		}
+def trigger_razorpay_subscription(data):
+	if isinstance(data, six.string_types):
+		data = json.loads(data)
 	data = frappe._dict(data)
 
-	pass
\ No newline at end of file
+	subscription = data.payload.get("subscription", {}).get('entity', {})
+	subscription = frappe._dict(subscription)
+
+	payment = data.payload.get("payment", {}).get('entity', {})
+	payment = frappe._dict(payment)
+
+	if data.event == "subscription.activated":
+		membership = get_membership_based_on_subscription(subscription.id, {"membership_status": "New"})
+	else
+		prev_membership = get_membership_based_on_subscription(subscription.id, {"payment_id": payment.id, "paid": 1})
+		if prev_membership:
+			print("payment already done")
+			return
+		prev_membership = get_membership_based_on_subscription(subscription.id)
+		membership = frappe.new_doc("Membership")
+		membership.update({
+			"member": prev_membership.member,
+			"membership_status": "Current",
+			"membership_type": prev_membership.membership_type,
+			"currency": "INR",
+		})
+
+	subscription_charged(subscription, payment, membership)
+
+def subscription_charged(subscription, payment, membership=None):
+	data = {
+		"subscription": subscription,
+		"payment": payment,
+	}
+	membership.paid = 1
+	membership.payment_id = payment.id
+	membership.webhook_payload = json.dumps(data, indent=4, sort_keys=True)
+	membership.from_date = datetime.fromtimestamp(subscription.current_start)
+	membership.to_date = datetime.fromtimestamp(subscription.current_end)
+	membership.amount = payment.amount / 100 # Convert to rupees from paise
+
+	if membership.is_new():
+		membership.insert()
+	else:
+		membership.save()
+
+	return True
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
