DEV Community

Cover image for Platform Lock-In is Not Your Problem
Lillian Dube
Lillian Dube

Posted on

Platform Lock-In is Not Your Problem

The Problem We Were Actually Solving

We were trying to build an e-commerce platform for a market with a largely unbanked population, where traditional payment gateways like PayPal, Stripe, and PayHip were off-limits due to regulatory restrictions. The business needed a way to accept cryptocurrency payments from users worldwide, without being held back by platform limitations.

What We Tried First (And Why It Failed)

Our initial approach was to use a third-party library that integrated multiple cryptocurrency payment gateways, including Coinbase and Binance. We thought this would give us the flexibility to switch between different gateways as needed and avoid vendor lock-in. However, we soon encountered issues with inconsistent API responses, overlapping payment fees, and inadequate error handling. The library's attempts to abstract away these complexities only added to our headaches. Eventually, we hit a wall when one of the gateways changed its API without notice, causing our entire payment processing system to break.

The Architecture Decision

We decided to abandon the "all-in-one" library approach and instead built a custom payment processing system that used each cryptocurrency gateway's native API. This allowed us to maintain fine-grained control over payment processing, switch between gateways seamlessly, and even implement our own caching mechanisms to reduce API calls. We chose to use the Web3.js library for interacting with the Ethereum blockchain and a custom-built API gateway for abstracting away the complexities of each gateway's API. This setup required significant upfront investment in development and testing, but it ultimately paid off in terms of flexibility and maintainability.

What The Numbers Said After

Our custom payment processing system reduced payment processing errors by 95% and increased payment processing throughputs by 300%. We were able to onboard new cryptocurrency gateways in a matter of weeks, rather than months, and saw a 25% reduction in transaction fees due to our ability to negotiate better rates with each gateway. Most importantly, we achieved 100% uptime for our payment processing system, even during periods of high traffic.

What I Would Do Differently

If I were to do this project again, I would focus even more on building a robust API gateway that abstracts away the complexities of each cryptocurrency gateway's API. I would also invest in more rigorous testing and simulation of our payment processing system, particularly under high traffic conditions. Additionally, I would consider using a more robust state machine library to manage the different states of each payment processing flow. While our custom payment processing system has been a resounding success, I'm always looking for ways to improve its reliability and scalability.

Top comments (0)