About the customer
LetKnow Pay provides digital payment processing solutions for merchants, offering a suite of products that empower businesses in the evolving world of crypto-enabled commerce.
At the core of the platform is an advanced e-commerce payment gateway, enabling merchants to accept digital asset payments with speed, security, and simplicity.
Challenges
LetKnow Pay is facing rapid growth and continuous fast developments in the crypto and digital assets market. New currencies, new regulatory requirements and a high number of daily transactions are pushing the development of a stable and traditional accounting system beyond the standard and easy deployment. Internal API and bank API are updated at a fast pace and must be transformed into a stable accounting system. Additionally, tens of thousands of bookings need to be handled every day, so every transaction needs to be as streamlined as possible.
LetKnow Pay therefore decided to go forward with Frappe and ERPNext, as it provided open-source, licence-free handling and existing workflows to build on.
Benefits
The Frappe Framework together with ERPNext were ideal for the deployment. The open source approach and existing complementary apps formed a stable and secure basis for the custom app development. The flexible approach to hook into existing functions proved very valuable.
The flexible approach lets LetKnow Pay roll out additional company benches within one week and no license costs are a plus for the whole organization.
Impact
Within 5 months after the initial start of the project, the custom app left the development system and was deployed first on Frappe Cloud for the first monthly based bookings and the first invoices issued by the system. After just two further months the staging system was stable enough to deploy on LetKnow Pay’s own infrastructure, ready for multi-month bookings. Initially most of the interfaces were handled via manual uploads, but soon were replaced by custom API. Just 8 months after the project start, the first reports were produced by the system.
They are an added value and save time compared with manually compiled data from different sources, and provide one interface to handle all back-office work in one place. Bank reconciliation was automated to a high degree dropping manual intervention or checking from almost 70% to below 5% of the transactions.
The full story
LetKnow Pay is a leading provider of digital payment processing solutions. With the crypto market being highly volatile, the challenge of the ERPNext implementation was to keep up with the fast development but also to provide the back office with a stable system that delivers data quickly and reliably and keeps pace with changing regulatory requirements.
With a 5-digit number of daily transactions, the input needed to be treated fast and reliably, and errors in the data needed to be flagged and not drop silently. Automation up to a point where human checks become possible and are required was the main challenge. Additionally, every week or month, new features were developed on the customer-facing side, so customization in the backend without touching code directly became necessary.
Initially, the first requirement was to connect the customer management system directly to ERPNext. The data provided was 99.9% accurate, but still required validity checks due to the 100% requirement for the accounting system.
Phase 1: From customer interactions to Journal Entries
The first phase analyzed the provided data and transformed every customer interaction, which may consist of many separate datasets from the frontend, into regular Journal Entries and the required accounts. Multiple challenges were faced during the laying out of this multi-layered booking transformation. The first to be solved was how to handle the various currencies per customer and the accuracy of each crypto currency, going beyond the often used 2 or 3 decimal places.
ERPNext is streamlined to handle one currency per customer and locks the customer for additional currencies as soon as one currency is assigned. The solution here was the accounting dimensions. This initially limited the transaction view per customer record, but custom accounting dimensions made it possible to handle the vast amount of possible crypto and fiat currencies. An accuracy of the provided 9 digits proved well for the accounting side, while Python itself, due to the floating-point precision error, affected many transactions. The test cases had to cover all these cases and the floating-point precision error needed to be considered for every transaction.
The next challenge was the accounting system itself. Every currency requires its own account. This requirement extended when handling also on-chain wallets vs offline storage (hot and cold wallets), and manual transactions between wallets. The accounts table became enormous and the system needed to learn which transaction, based on a set of rules, has to be booked in a certain way. As a second layer, each booking required a reference table to allow the system to pick the appropriate account based on currency, payment gateway that receives crypto (crypto gate) or bank. Many more requirements and filters were introduced in phase 1 until a full configuration of every business case could be handled.
Phase 2: More than 1000 test cases
The second phase started after the first transactions were able to be booked. This phase used many real examples and built a catalogue of unit tests to form a system that can be customized in the frontend, but during setup and for code changes can rely on a huge amount of tests to avoid regressions. This phase considerably created more than 1000 test cases. In order to support fast deployment for multiple entities of the company with each having its own legal requirements, but also to support all unit tests based on real data, the fixture system was extended.
Fixtures now handle not only the basics like currencies, accounts and company and ERPNext settings, but also almost all rule sets required for the correct booking. Even though there is a frontend for customization, the system stores as backup all transaction and account assignments. This creates a slight overhead, as the frontend and the benches might diverge from the codebase, but this allows changes to be adapted fast in the running system, while the administrator has a bit more time to take over the new requirements in the code. This way, a fast change due to new requirements is possible, but is then backed up by fixed rules in the code that are unit tested in the long run. This also allows copying rulesets from bench to bench. An additional env-file keeps company-specific data and a custom fixture migration tool converts fixtures into custom bench fixtures during deploy or migrations.
With the framework flexible enough to go through these adaptations, phase 1 and 2 were completed in only 5 months. The internal communication between the customer and implementation provider is a key to success: one-on-one communication with a fast decision enabled quick iterations on code and changes.
Phase 3: Staging, reporting and invoices
In phase 3, the staging system became active and monthly reporting in parallel to the old reporting system were created. This included also the issuing of sales invoices. This required additional layers in ERPNext and compromises in the custom app, as one currency per customer limits from the core blocked many tries for a flexible system. In the end, a custom sales invoice controller handling multi-currencies within the ERPNext core boundaries was acceptable. This allows the full system to update fast and reliably. No core changes were required overall, so a full run of all unit tests combined with successful runs of the other implemented apps creates a safe zone for regular updates.
Bank reconciliation becomes reconciliation in general
Additionally, complementary apps for bank reconciliation, PDF on submit and in-app user documentation (Compendium) complemented the project. Bank reconciliation required new thinking as it required additional hooks for custom document handling. Traditionally, bank transactions are reconciled against sales or purchase invoices, sometimes against Journal Entries or various other existing documents. The custom app required additional documents to be handled for two reasons: first as the bank transactions became the center of unreconciled transactions in general, and second for the reconciliation of the new transaction types that required custom reconciliation.
Bank Transactions started to store everything the system could not assign automatically, everything that was in doubt and everything that required manual intervention due to legal requirements. The user interface is key here. The accountant only requires one view to check for open transactions. As edge cases also started to arrive here, bank reconciliation became reconciliation in general. Hooking into other custom apps — in this case the banking app — was the key. Custom interactions and reconciliations were now proposed to the accountant, all deriving from the core rule set for all transactions.
Handover
The flexibility of ERPNext and Frappe, along with the possibility to hook into other apps without adapting their code, was a key success factor for the project. After 12 months, the project was handed over to LetKnow Pay’s in-house development team to continue the development and support for all internal customers. This includes the integration of further modules and apps like the CRM system, billing and bank and the API for LetKnow Pay’s crypto payment gateway.