The Problem We Were Actually Solving
Our company, a platform for creators, needed a payment system that would work seamlessly worldwide, without relying on legacy banking systems. We wanted to enable creators to sell digital goods and receive payment in their local currency, without the hassle of foreign exchange fees or delayed transactions. We knew that the key to making this work lay in leveraging cryptocurrency, which lets us bypass traditional payment rails.
What We Tried First (And Why It Failed)
In the beginning, we opted to use a platform store like Stripe, which we thought would simplify our lives and let us focus on other aspects of the business. It took us about 2 weeks to set up and integrate, but the tradeoff quickly became apparent. Foreign exchange fees ate into our margins, and the latency between payment receipt and transfer to the creator was around 3-4 days. Not to mention the fact that Stripe restricted us from operating in certain countries, due to their own anti-money laundering policies. Our solution was far from ideal.
The Architecture Decision
After months of research and prototyping, we decided to automate order fulfillment for crypto payments from scratch. We chose to use the MetaMask API for browser-based wallets and the Chainlink Keepers for off-chain order fulfillment. This new architecture allowed us to take full control over the payment flow, which not only eliminated foreign exchange fees but also got payments to creators in under 24 hours. We achieved this by using smart contracts on the Ethereum blockchain to hold the funds until the creator's order had been fulfilled, and then releasing them. We wrote our own custom API to handle these smart contracts and integrate them with our application.
What The Numbers Said After
By going fully custom, we were able to reduce our payment processing costs by 95% and cut down the average transaction latency to under 25 minutes. Queries on our database for order fulfillment only took 15 ms, a huge improvement over the 200 ms it used to take on the platform store. Our creators were able to receive payments in their local currency without any hassle, and the lack of foreign exchange fees meant higher earnings for them. We met our target of offering seamless global payments, without any geographical restrictions.
What I Would Do Differently
In hindsight, I would have built the custom payment system first, rather than going with the platform store. The time and effort we spent trying to work around its limitations could have been spent building something tailored to our needs. Additionally, I would have dug deeper into the smart contract logic and explored more complex use-cases. I would also have implemented some form of automated testing and deployment for the custom API to ensure its reliability and scalability. Looking back, the DIY payment solution was the right choice, but it required a good amount of trial and error to get it working smoothly.
Top comments (0)