• stone
  • stone
  • stone
.netcore

Stone

Microservice for Interchange calculation.

2019
01 Introduction Stone is a Brazilian company that offers payment solutions for card machines. Stone is what we call an acquiring company, which basically works as a bridge between card companies and issuing banks to process financial transactions.
01.1 MDR

When making a purchase at an establishment with our credit or debit card, a fee is charged by the acquiring companies on each transaction. This fee is called MDR (Merchant Discount Rate). The acquirer passes on the purchase price to the shopkeeper, the MDR is deducted, thus, the shopkeeper receives the net value of the transaction.

01.2 INTERCHANGE

Card companies such as VISA, Elo, MasterCard, Hipercard, etc., have different transfer rules, besides having different rates for each type of card (individual or corporate). We call this interchange fee.

01.3 MONTHLY FEES

Stone must calculate the amounts to be paid on a monthly basis based on all transactions in the period and transfer the amounts to each entity.

  • Difi
  • cul
  • ties
02 Change Request

For every request to change a card company's rule or fee, Stone should change the system in order to calculate the amount to be paid.

02.1 Disengage of the Engine

Stone would like to disengage the engine from the authorizer service and that all dynamic rules occured quickly and easily, without the need to perform any deployments. Besides that, the service should start running in real time, without creating batches of processing, so that metrics could be obtained in real time.

Challenge: CREATE A ROBUST MICRO SERVICE OF INTERCHANGE CALCULATION THAT WOULD BE ABLE TO MEET ALL TRANSACTIONS CARRIED OUT BY STONE.

Solution
04 Solution

CREATION OF MICROSERVICE

At first, we understood the microservices model used at Stone. We analyzed points that could be improved and followed up with what was appropriate.
We created a microservice following all good development practices, using centralized logging services, auditing, Kubernetes cluster, CI/CD etc., services that were already being used well at Stone.

04.1 Solution

DEVELOPING A TEST SUITE

We believe that the main development technique which guarantees the quality of the system in the long run is the development of a strong suite of automated tests and that this suite constantly evolves with coding. In this project we carried out three layer tests, unit tests, integration and End to End with a total of more than 80% of the project's coverage.

04.2 Solution

FRAUD RISK ANALYSIS

Before putting it into production, we performed several load tests, reaching up to 1k requests per second.

With the microservice finalized, we put them into production in parallel with the old service, confronting the calculation of both. First, we compared the operation with the old service, identified the correct one and the business rules were validated.

04.3 Solution

TECHNOLOGIES USED

- .Net Core
- Memory Cache
- PostgreSQL
- Redis
- Azure Devops

  • Solut
  • ion
05 Success

We put the first card company in production and the customer was very satisfied with the result. We were assertive in the "cents". After the validation of the first company, we put other companies on the air and we are already going to the third.

Tags User Experience User Interface Stone APP