DigiOutsource Software Development Manager, Frans, illustrates the functionality of Micro Services Architecture using Payment Gateway Transactions as an example.
At the age of 8, a curious Frans eagerly watched his cousin set up an old 486 PC with an operating system of DOS 5. It was in those moments of observing the complex nature of how technology was put together that Frans was hooked on learning more. It set the tone for his future that has led him to the fascinating world of software development today.
Frans completed his BSc Computer Science and Computer Engineering in 2004 at North West University. Upon completion, Frans worked as an IT, CAT, and Mathematics teacher, landing his first programming job in 2007 at Entelect Solutions Johannesburg. At the end of 2011, after 4 years with Entelect Solutions, Frans took the leap and moved to Cape Town where he took up a role as Senior Web Developer at HomeChoice for a 2-year period.
In 2014, Frans began his journey within the DigiOutsource family, first at DigiProcessing until the Banking Dev team he was part of merged with DigiOutsource. Frans is now a Software Development Manager (SDM) at DigiOutsource, and during his almost 15-years in the field he has not lost his passion for the complex, problem solving nature of the software development environment.
Micro Services Application to Payment Gateway Transactions
A few years ago, every application was written as one monolithic application, meaning that the application had all aspects crammed together: input, output, and UI as one big solution. This meant that if something went wrong within the application, the whole system would be affected. A decision was made to implement Micro Services Architecture.
The question in the room is, ‘what is Micro Services?’ Micro services are smaller services that make up a bigger application. These services are maintainable and independent from other parts of the system, and structured around functionality or business capability. This allows a change to one component without affecting other services. This doesn’t mean it doesn’t have its drawbacks - which I will explain later in this article.
Micro Services Role in Payment Gateways
When designing a system with Micro Services architecture it is very important to fully understand the functionality that the system will need to cater to. Below I will discuss a Payment Gateway as it illustrates how Micro Services are structured.
Before I start with laying out the Payment Gateway, here are a few points that every Micro Services system adheres to:
• Database per service
• API endpoints
• Can be deployed over multiple hosts, VM’s or containers and can have multiple instances.
To describe the main functionality I need to define a Payment Gateway: it is a system that allows clients to make secure transactions via multiple payment methods, and confirms the status of transactions at all times. For this example, the Payment Gateway has a public facing API, allowing users to interact with the rest of the functionality. Transactions are sent to the API via API-endpoints with key information to identify the client and respective payment method, as well as information about the transaction. Every new transaction will be added to a queue. A separate system subscribes to a queue, and according to client and payment method this system decides what should happen with the transaction. This service uses many smaller services to achieve the goal of performing a transaction.
For every transaction a specific process needs to be created and followed. This is done via a Transaction Micro Service that does the Creation, Update, Deletion and Reading (CRUD) of a transaction according to criteria and different API endpoints.
The next micro service in the process is the Validation Micro Service. Every payment method has its corresponding currency, country, and limits that need to be applied per client. This is stored in a validation database and this data is used to validate the transaction. If any currency conversion is required this micro service will ‘call’ another micro service to acquire exchange rates.
To check if a transaction has valid credentials, a processor will be retrieved from a Credentials Micro Service.
The final step is the processing of the transaction via a Processor Micro Service.
As can be seen from the Micro Services in the above Payment Gateway, each micro service caters to a specific functionality in the chain to complete transactions. From credentials, transaction logging, validation, and processors, all need to work together to complete a transaction.
However, there are drawbacks regarding this specific example. Such as, any issues experienced in Micro Services key to a deposit flow will cause a transaction to fail. On the other side of this, if one of the Micro Services is down it can be identified, singled out, and fixed without affecting the rest of the system.