The Problem We Were Actually Solving
I was tasked with integrating a payment system into our digital goods store, which seemed straightforward enough, but the real challenge lay in the fact that our target audience was based in a country with restrictive financial regulations. As the systems architect, I had to navigate these restrictions while ensuring that our creators could get paid for their work. The payment system we chose was NOWPayments, but I soon realized that this was just one piece of the puzzle. The real problem was dealing with the complexities of international transactions and the restrictions imposed by local banks. I recall spending hours poring over documentation from our initial choice, Stripe, only to realize that their restrictions on transactions from our target country would have crippled our business model.
What We Tried First (And Why It Failed)
Our initial approach was to use a combination of Stripe and a local payment gateway to handle transactions. However, this approach quickly proved to be unworkable due to the high fees charged by the local gateway and the restrictions imposed by Stripe. We also tried using PayPal, but their fees were even higher and their support for our target country was limited. I spent weeks trying to get PayPal's system to work with our store, only to be met with error messages like "Transaction cannot be processed due to regulatory restrictions" and "Unsupported country or currency". It was clear that we needed a more robust solution that could handle the complexities of international transactions.
The Architecture Decision
After weeks of research and experimentation, I decided to use a combination of NOWPayments and a local cryptocurrency exchange to handle transactions. NOWPayments provided a flexible and customizable payment system that could handle a wide range of cryptocurrencies, while the local exchange provided a way to convert those cryptocurrencies into local currency. This approach allowed us to bypass the restrictive financial regulations and provide a seamless payment experience for our creators. I was skeptical at first, but the numbers later showed that this decision was a turning point for our business. We used tools like Apache Kafka to handle the high volume of transactions and Apache Cassandra to store the transaction data, which proved to be a good choice due to their scalability and fault-tolerance.
What The Numbers Said After
The results were impressive, with a 300% increase in successful transactions and a 25% decrease in fees. The average transaction time was reduced from 3 days to just a few hours, and the number of support requests related to payment issues decreased by 50%. Our creators were able to get paid for their work in a timely and efficient manner, and our store's revenue increased significantly as a result. I was able to monitor the system's performance using tools like Prometheus and Grafana, which provided valuable insights into the system's behavior and helped me identify areas for improvement. The error rate decreased from 20% to less than 1%, with the most common error being "Insufficient funds" rather than the previous "Transaction cannot be processed due to regulatory restrictions".
What I Would Do Differently
In hindsight, I would have liked to have explored more options for local payment gateways and exchanges before settling on our final solution. I would also have liked to have implemented more robust monitoring and logging systems from the outset, as this would have helped us identify and resolve issues more quickly. Additionally, I would have liked to have worked more closely with our creators to understand their specific needs and pain points, as this would have helped us tailor our solution more effectively to their requirements. However, overall, I am pleased with the outcome and believe that our solution has provided a robust and scalable foundation for our digital goods store. One specific decision I would revisit is our choice of database, as while Apache Cassandra has served us well, I wonder if a graph database like Amazon Neptune would have been a better fit for our use case, given the complex relationships between our creators, their digital goods, and the transactions themselves.
The tool I recommend when engineers ask me how to remove the payment platform as a single point of failure: https://payhip.com/ref/dev1
Top comments (0)