Frappe and ERPNext at IFF
Automating memberships at IFF with ERPNext, so they can focus on keeping the Internet free and healthy.
Over the past couple of months, the Frappe team has been working with the Internet Freedom Foundation (IFF) to build automation pieces for their donation processing systems especially for the recurring giving program i.e. the IFF memberships.
About Internet Freedom Foundation
Internet Freedom Foundation is a non profit organization in India. Born out of the SaveTheInternet.in movement for net neutrality, IFF intitiatives work towards informing people about issues including net neutrality, free expression, privacy, and open innovation. IFF's projects and activities are a part of a larger ongoing effort of ensuring that technology respects fundamental rights and liberties guaranteed by the Constitution.
IFF sustains its activities by support from organizations, but more importantly from recurring contributions from individuals. All these membership payments happen through Razorpay (Payment Gateway). Until recently the only option we had available to members was to create recurring subscriptions using a limited number of Credit Cards, this changed when Razorpay started supporting e-Mandate.
E-Mandate is a new payment service that allows anyone with a bank account/debit card to easily automate recurring payments. However, unlike the credit card based subscription, the recurring payment had to be deducted manually every month from the Razorpay dashboard, which is a time-consuming and quite likely a more error-prone process.
Challenges with scaling
The entire membership process was managed through Razorpay dashboard and spreadsheets, however, with more donors starting to support IFF in their work it was getting difficult to scale this process. Especially after bringing E-Mandate based payments, manually triggering payments each month for members is something that will never scale as it should.
Additionally, we had to send a welcome email to each member when they signed up, and also an 80G Certificate at the end of the financial year. (FYI, an 80G certification is one that is granted to certain not-for-profit organizations by the Income Tax Department, granting their donors the ability to avail of a tax deduction on donations)
The requirement was for a CRM catered towards non-profits, with first-class integration to Razorpay. With ERPNext the problem was half solved.
The journey with ERPNext
Apar Gupta, the Executive Director at IFF met Rushabh, our founder, at IndiaOS. The values of freedom and openness align strongly between the two organizations. Soon after, we invited Apar to our office to interact with the rest of our team and to share his work with us.
Later, when IFF felt the need for a sophisticated system to manage its operations, ERPNext became the obvious choice. The conversation began and we volunteered right away. As a tech company committed to building free software for the society, the freedom and openness of the internet is something that’s close to our hearts, an opportunity to help IFF strengthen their initiatives is something we were happy to take up right away.
ERPNext has newsletters, print formats, notifications out of the box, it is just a matter of configuration to get them live. The core piece that tracks the members, their membership payments, and more was already ready to be used in the Non Profit module. Over the next few months, we migrated the members’ list to ERPNext, I wrote endpoints that were triggered by the Razorpay web hooks when any new subscription payment was made. This was a relatively painless process, with only a few hiccups coming our way. All the new features were added to the ERPNext codebase directly, ensuring that any other non-profit can take full benefit of this.
The next piece was adding E-Mandate support, for this we decided to build an app on top of ERPNext. The Frappe Framework has a highly extensible architecture allowing for apps to extend functionalities and add new features to existing apps with minimal coding.
The next couple of months involved a lot of calls with the IFF team, with the Razorpay integration team, and quite a few experiments. The Razorpay documentation for this particular feature was a bit confusing to begin with, (which is unlike their other products), however, a call with their integration team did solve all our doubts. We did quite a bit of sprinting between documentation pages to figure the exact flow of the payments, but once it all came together we were able to write the pieces for this code.
The subscription system was already in place, we decided to extend the same architecture for E-Mandates. The following is the e-mandate flow as shown in the diagram above.
- Member details are sent to E Mandate lambda, a serverless function hosted on AWS
- The lambda calls Razorpay with the details, which generates a token and an order
- This token is sent to ERPNext, where the token is stored and marked as initialized
- The token and the order details are passed to the IFF website which is then processed by Razorpay
- The token has to be confirmed by the bank, which takes a while to process, when it is confirmed a web hook is triggered which ERPNext listens to and updates the token status in its database
- Following this, every subsequent month, depending on the plan the member is on, the payment is triggered via Razorpay API from ERPNext
We put this system in place, after a few weeks of testing we finally are live with E-Mandate payments on the donate page, which essentially means that we have been able to fully automate the recurring payments through E-Mandate and will be able to sign-up members through Net Banking and Debit Cards.
We started working on this custom integration using e-mandate mainly because Razorpay does not natively support inbuilt-scheduling for e-mandate based recurring payments.
On July 23rd Razorpay announced UPI Autopay, which offers features like an inbuilt scheduler among other things, at the convenience of UPI apps customers are already familiar with. But as of writing this post, Razorpay has confirmed that it will take a while until all the above-said features are enabled on their end. We plan on integrating UPI subscriptions when it goes live and is stable enough for our purposes.
While doing these projects lots of avenues of improving the ERPNext Non Profit Module showed up, and we're steadily acting on those and pushing those changes incrementally. Some major features that we've already pushed include automatic invoice generation, sending acknowledgments with a single click, and other minor improvements.
Are you a non-profit?
All the code we created during the course of this project has been published under a free license allowing anyone to use it for their non-profits. Following are the links to those project repositories:
There's a suite of great features, comprehensive in their coverage we ship inside ERPNext that can help your organization scale in operations and become more efficient, just like the Internet Freedom Foundation did. If you want to give this a try sign-up on erpnext.com or get in touch with us.
Framework Engineering at Frappe
No comments yet. Login to start a new discussion Start a new discussion