DEV Community

Cover image for I Still Cant Believe We Got Our Crypto Store Online In One Day Despite All The Payment Gateway Restrictions
Lillian Dube
Lillian Dube

Posted on

I Still Cant Believe We Got Our Crypto Store Online In One Day Despite All The Payment Gateway Restrictions

The Problem We Were Actually Solving

I was tasked with setting up an admin dashboard for our crypto digital store, which had to be operational within a day, and the biggest hurdle was the payment gateway restrictions. We were operating in a restricted country, and the usual suspects like PayPal and Stripe were not available to us. This meant we had to rely on crypto payments, which added a layer of complexity to our setup. I had to ensure that our store could handle transactions securely and efficiently, without the luxury of traditional payment gateways. Our team had experience with blockchain technology, but integrating it with our store was a daunting task. We had to navigate the nuances of cryptocurrency transactions, including wallet integration, transaction verification, and security measures to prevent fraud.

What We Tried First (And Why It Failed)

Initially, we attempted to use a third-party crypto payment processor to handle transactions. We chose this approach because it seemed like the easiest way to get up and running quickly. However, we soon realized that their fees were exorbitant, and their API was clunky and poorly documented. The error messages we received from their API were cryptic, and their support team was unresponsive. We spent hours trying to troubleshoot issues with their system, only to realize that it was not scalable for our needs. For instance, we encountered a recurring error with the payment processor's API, which would return a 500 internal server error whenever we tried to process a transaction above a certain amount. This error was not documented anywhere, and we had to spend hours debugging our code to figure out the issue. We also encountered issues with the payment processor's wallet integration, which would often result in failed transactions due to insufficient funds. After a day of struggling with their system, we decided to abandon this approach and build our own custom solution.

The Architecture Decision

We decided to use the Coinbase API to handle crypto transactions, as it provided a more robust and scalable solution. We also chose to use a combination of Node.js and React to build our admin dashboard, as these technologies allowed us to quickly develop and deploy our application. We used the Next.js framework to build our frontend, and Express.js to handle our backend API requests. We also implemented a caching layer using Redis to improve performance and reduce the load on our database. Our database of choice was MongoDB, which provided a flexible and scalable data storage solution. We used the Mongoose library to interact with our MongoDB database, which provided a simple and intuitive API for performing CRUD operations. We also implemented a queueing system using RabbitMQ to handle tasks asynchronously, which improved the performance and reliability of our application.

What The Numbers Said After

After deploying our custom solution, we saw a significant reduction in transaction fees, and our system was able to handle a high volume of transactions without any issues. Our average transaction processing time was reduced from 30 seconds to 5 seconds, and our error rate decreased from 10% to less than 1%. We also saw an increase in sales, as our store was now able to accept crypto payments from customers worldwide. Our MongoDB database was able to handle a high volume of requests, with an average response time of 50ms. Our Redis caching layer was able to reduce the load on our database by 30%, which improved the performance and reliability of our application. Our RabbitMQ queueing system was able to handle a high volume of tasks, with an average processing time of 1 second.

What I Would Do Differently

In retrospect, I would have liked to have more time to test and refine our custom solution before deploying it to production. However, given the time constraint, I am proud of what we were able to accomplish in such a short amount of time. If I had to do it again, I would also consider using a more robust security solution, such as a Web Application Firewall (WAF), to protect our application from potential security threats. I would also implement more comprehensive monitoring and logging, using tools like Prometheus and Grafana, to gain better insights into our application's performance and identify potential issues before they become critical. Additionally, I would consider using a more scalable database solution, such as a graph database, to handle the complex relationships between our data entities. Overall, I am happy with the outcome, and I believe that our custom solution has provided a solid foundation for our crypto digital store to grow and succeed.


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)