Payment Gatway Final
Payment Gatway Final
The records era (IT) has revolutionized the diverse factors of our lives; specifically it has
provided an easy way to go for digital payments. During the Demonetization period, the
government of India compelled the human beings at once or indirectly to do all industrial
transactions through virtual mode. The common people started to move from conventional
payment systems closer to virtual bills systems which ensured security, at ease and convenience.
With large technological leaps inside the clever phone and clean net access has led the
Indian market to simply accept digital bills. the proportion of the virtual payments via other
modes is likewise increasing in a sizable speed. The objective of the existing examination is to
recognise approximately the numerous types of digital price transactions which are used by the
commonplace people in their day-to-today's lives. This have a look at is mainly primarily based
on Secondary statistics. The result shows that the virtual revolution has made the cash much less
transaction and a cleaner one. As a result that in 2015-2016, a total of 4018 billion has been
transacted through cell banking whilst in comparison to 60 billion in 2012-thirteen.The reach of
cellular community, net and energy is likewise expanding digital bills to remote areas. So, it's
definitely said that the Destiny transaction device is a cashless transaction.
The widespread adoption of virtualization, microservices, and cloud-native technologies
has made API-based interaction between service entities the standard. Due to commercial needs,
many platforms still maintain a huge number of obsolete APIs. Simultaneously, many new APIs
are increasingly becoming available. If your API communicates with a third-party app, you
should be curious about how that app distributes data to the Internet. For example, you might not
be concerned about someone learning the contents of your refrigerator, but you might be if that
individual can use the same API to locate you. So, the one of the important things is to give an
attempt to have a secure adaptation of the API.
IV
Figure 1. Payment API model
The Task of this project is to come up with the designing and developing the online
Payment API which will be easy to test and maintain. And the API should be able to
provide the services to the various online purchasing e-commerce companies and more.
An utility programming interface is classical records that allows two devices, databases
or programs to connect and proportion statistics. In other words, it's the language
backstage software program that makes it clean for us to do things online or with our
smartphones.
We use the API all of the time, whether or not we know it or no longer. As an instance,
when we buy airline tickets through a 3rd-party celebration tour reservation website, the
API authorizes verbal exchange between the airline and the tour company. Or if we've
got a software development kit thermostat in our domestic, the API allows
communication that allows it to modify the temperature remotely in a character room.
The Task of this project is to come up with the designing and developing the online
Payment API which will be east to test and maintain. And the API should be able
to
3
provide the services to the various online purchasing e-commerce companies and
more.
1.3 Objectives
• The goal of the undertaking is to offer a fee gateway API version to correctly test
and maintain the API and make the API capable of work smoothly. in this work,
we gift a semi-supervised gaining knowledge of method that outperforms, even
greater, the performance of API in terms of the modelling of the API and the
relationship between the two APIs which is established thru the relaxation
Template. There are distinctive functions that can or won't be to be had,
depending at the API and processing platform. as an example, there’s the
capability to save transactions offline and feature them processed whilst capability
is restored. Or the API can be able to aid a diverse array of diverse transaction
types past the fundamental card manufacturers and not unusual charge strategies.
• furthermore, a rate API can be able to consolidate all the statistics transmitted via
the platform, thereby providing useful statistics that has the potential to inform
business organization and advertising and advertising and marketing choices.
• The security is one of the most important aspect of any API or a website. For
authentication purposes, it is also necessary to use some technology to
authenticate the user in the APIs. For this objective, I have used the hashing
algorithms in both the APIs.
1.4 Methodology
The idea is to build an API for the Payment API Gateway. For this purpose, there is two
separate APIs built to perform the complete two different services. The different service
would be :
4
User_Service : It’s main tasks would be
• Create Wallet.
One fundamental gain of a rate API is that it may beautify a client’s shopping enjoy
through doing away with the want to fill out checkout bureaucracy, a tedious challenge -
especially on a telephone - that may result in shopping cart abandonment. thanks to the
capacity to reuse stored rate information, customers can complete a purchase on a cell
device with only a few taps.
This Project is completely based on backend working. The main methods, technologies
and tools that are associated with this project are:
Methods Used:
• Microservice Architecture
• Auto Configuration
• Hashing Algorithm
• Authentication
Technologies Used:
• Java
• SpringBoot
• Swaggers
• Hibernate
• Rest Template
• Actuators
• MySQL
Every of the technologies are freely to be had and the technical capabilities required are
attainable. Time obstacles of the product development and the benefit of implementing
the usage of those technologies are synchronized. From these it’s clean that the
assignment is technically feasible.
6
Figure 4. Design of an API in microservice architecture
In this case, beginning from the pinnacle left nook, a user sends an occasion or message to
execute a payment as an access point. The customers can be cellular, internet, or any outside
tool / utility that acts as the entry factor with the groups payments structure.
This request to execute bills connects to your services thru the bills API. this is the bridge to
the internal relevant payments occasion streams, where streams are managed to decide what
selection or sub-choice of moves need to be taken. For practical functions, we'll proceed thru
this architecture as if all alternatives are necessary to make sure coverage of all elements and
offerings.
the first motion taken is validation of the incoming bills request, the usage of the validation
microservices presenting integration to all wanted systems in an corporation to validate
finances, customers (users), and more. as soon as validation is completed a message is sent
back to the payments event streams for similarly processing.
the following two levels of the bills architecture are not constantly necessary as they rely
upon validation consequences. If there are any issues or flags raised on a payment request
then the subsequent step could be to trigger using the anti-cash laundering (AML)
microservices or fraud detection microservices. every of those collections decide if action
desires to be taken, if payment requests want to be blocked, if the consumer wishes to be
14
suggested, and in all likelihood blocking funds. Both of these service regions are leveraging
information caching to ensure current information is available to the selection control tooling
used to lower back those processing levels. Any consequences are then pushed lower back to
the bills occasion streams for in addition processing.
Following the procedure elements to the proper we're going to arrive on the clearing
microservices in which processing for actual payment budget planning wherein accounts are
debited earlier than routing the price range to the requested events. These outcomes are sent
back to the bills event streams for processing.
Subsequently, routing microservices are accessed to ensure the price range from the
processed bills are distributed to the indicated parties thru the to be had bills community.
notice that the bills community is shown as an external secure cloud element, supposed to
suggest only that it's an external network and dependent on the place the answer is being
deployed in for specifics as to the connection and information protocols used.
The second discern at the proper here is labeled as a direct bills facts instance and is meant to
offer greater insights into the motion of event streams and glide of statistics through the
above described system of executing on a bills request. Exploring the information of this
figure is left to the reader.
• Start
• Go to the Spring Initializr website.
• Include the dependencies like MySQL Driver, JPA /Hibernate, Spring web, etc.
• After that click on build Spring Boot application.
• Then, open the project in IntellIJ.
• Then build controllers, models of the API, Repositories, and Services.
• Then connect the MySQL database to the application using JPA/Hibernate.
• Then write GetMapping , PutMapping, etc. to perform functions in the API.
• Built another API with the same Configuration.
• Then, use Rest Template to connect between two or more APIs.
• End
15
3.3 Model Development:
Microservices architecture scalability is terrific for permitting aid for a huge variety of
platforms and devices as internet, mobile and IoT backend can be deployed, constant, and up
to date independently of every different. Microservices are small and flexible, which means
that you don’t should have interaction with a large code base on every occasion your crew
wants to make a change within the code.
Alternatively, development groups can choose exactly the portions of code they need to
engage with and enhance each productiveness and maintainability. eventually, it promotes the
idea of groups reusing each other’s code as opposed to developing independently and from
scratch.
Microservices structure is especially vital for DevOps groups because it gives accelerated
agility so the group can roll updates out lots faster--and extra tailor-made to every crew’s
timeline--because of shorter build, take a look at, and installation cycles. Reliability is also
increased seeing that an issue with one microservice only influences that microservice, no
longer the complete application. This substantially reduces any opportunity of the complete
software failing.
Microservices are also extraordinarily modifiable, providing teams the ability to apply new
frameworks, libraries, and records resources. the main concept is that microservices
architecture intentionally leverages agile concepts, in which the development attempt is
unfold across go-purposeful teams that work extra independently.
16
Classification Setup: -
The idea is to build an API for the Payment API Gateway. For this purpose, there is two
separate APIs built to perform the complete two different services. The different service
would be :
-Create Wallet.
-We should be able to sent transaction to the user if he wants on their mail.
One major gain of a charge API is that it can enhance a consumer’s purchasing
experience via casting off the want to fill out checkout forms, a tedious venture - mainly
on a smartphone - which can lead to purchasing cart abandonment. thanks to the ability to
reuse saved charge statistics, clients can entire a purchase on a cellular tool with just a
few faucets.
17
Figure 5. Different services to be used in the API
The below are the some glimpses of the code written to make an API functional :
18
The above class is a controller class. The most of the functions or the requests which are
passed to the API are functional here. The controller class is for the user_service API.
1. The first request in above code if the @GetMapping , which returns all the users
to the client in the form of JSON or XML.
2. The second request is the @PostMapping , which is to register a new user into the
MySQL database.
3. The third and the last request is the @GetMapping for finding the user by id.
Whenever the function is called, the controller is called by the main class to function, and the
identity of the controller class is recognized by the @RestController annotation of the java
class.
19
The above class is the model class named User.java. The structure of an API and data
consumed by the API is all designed in this class. @Entity is used for Object Relational
Mapping in this class.
The below image is the complete structure of the User_Service API .The controller and
model class is discussed above. The Repository class is the class which connects the MySQL
database to the application .The functionality of each package is given below:
3. Model- It contains the classes defining the model structure of the API.
4. Repository- It contains the classes which connects the database with the particular
model class.
20
One of the most critical aspects of any API or website is security. It is also required to employ
some technique to authenticate the user in the APIs for authentication reasons. I used the hashing
techniques in both APIs to achieve this goal.
Above shown flow chart is the description of the model that I have used in the microservice
architecture APIs that I have designed.
21