Payment Service
What is the Payment Service?
Payment service is a system that receive and manages transfer transactions. It depend on the auth and business services respectively as a core dependency. Both services serves as means of authentication and authorization.
Routes
Banks
GET("/banks") or POST("/banks")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Customers
GET("/customers") or POST("/customers")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"filter":"boolean | required"
"more":"boolean | required"
"pageNumber": 1, // required
"batchNumber": 10, // required
"sort": "required", // ASC | DESC
"orderBy" :"required", // go to GET("/allowed-query/fields/customers") to see accepted fields
"groups": [{
"filterGroupCondition":"required" // AND | OR
"filterSearchCondition":"required" // AND | OR
"filters": [{
"filterOption": "eq",
"field": "", // go to GET("/allowed-query/fields/customers") to see accepted fields
"value": "user input",
"dataType": "string" // string | number | bool | date | dateTime
}]
}]
}
GET("/customers/details/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
POST("/customers/create")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"businessId": "required",
"bankId": "required",
"transactionReference": "required",
"amount": "number | required",
"duration": "number | required",
"firstName": "required",
"lastName": "required",
"email": "required",
"phoneNumber": "",
"address": ""
"refundBankId": "required"
"refundBankAccountNumber": "required"
}
PUT("/customers/update/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"firstName": "",
"lastName": "",
"email": "",
"phoneNumber": "",
"address": ""
}
DELETE("/customers/delete/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Customer Accounts
GET("/customer-accounts") or POST("/customer-accounts")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"filter":"boolean | required"
"more":"boolean | required"
"pageNumber": 1, // required
"batchNumber": 10, // required
"sort": "required", // ASC | DESC
"orderBy" :"required", // go to GET("/allowed-query/fields/customer-accounts") to see accepted fields
"groups": [{
"filterGroupCondition":"required" // AND | OR
"filterSearchCondition":"required" // AND | OR
"filters": [{
"filterOption": "eq",
"field": "", // go to GET("/allowed-query/fields/customer-accounts") to see accepted fields
"value": "user input",
"dataType": "string" // string | number | bool | date | dateTime
}]
}]
}
GET("/customer-accounts/details/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
PUT("/customer-accounts/update/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"RefundBankId": "",
"RefundBankAccountNumber": ""
}
DELETE("/customer-accounts/delete/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Payment links
GET("/payment-links") or POST("/payment-links")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"filter":"boolean | required"
"more":"boolean | required"
"pageNumber": 1, // required
"batchNumber": 10, // required
"sort": "required", // ASC | DESC
"orderBy" :"required", // go to GET("/allowed-query/fields/payment-links") to see accepted fields
"groups": [{
"filterGroupCondition":"required" // AND | OR
"filterSearchCondition":"required" // AND | OR
"filters": [{
"filterOption": "eq",
"field": "", // go to GET("/allowed-query/fields/payment-links") to see accepted fields
"value": "user input",
"dataType": "string" // string | number | bool | date | dateTime
}]
}]
}
GET("/payment-links/details/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
POST("/payment-links/create")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"businessId": "required",
"bankId": "required",
"amount": "number | required",
"duration": "number | required",
"firstName": "required",
"lastName": "required",
"email": "required",
"phoneNumber": "",
"address": ""
}
PUT("/payment-links/update/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"refundBankId": "required"
"refundBankAccountNumber": "required"
}
DELETE("/payment-links/delete/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Stella VA
GET("/stella-va") or POST("/stella-va")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"filter":"boolean | required"
"more":"boolean | required"
"pageNumber": 1, // required
"batchNumber": 10, // required
"sort": "required", // ASC | DESC
"orderBy" :"required", // go to GET("/allowed-query/fields/stella-va") to see accepted fields
"groups": [{
"filterGroupCondition":"required" // AND | OR
"filterSearchCondition":"required" // AND | OR
"filters": [{
"filterOption": "eq",
"field": "", // go to GET("/allowed-query/fields/stella-va") to see accepted fields
"value": "user input",
"dataType": "string" // string | number | bool | date | dateTime
}]
}]
}
GET("/stella-va/details/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
GET("/stella-va/create")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"businessId": "required",
"bankId": "required",
"firstName": "required",
"lastName": "required"
}
GET("/stella-va/create-timed-account")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"businessId": "required",
"bankId": "required",
"firstName": "required",
"lastName": "required",
"amount": "required",
"duration": "required",
"refundBankId": "required",
"refundBankAccountNumber": "required"
}
Payment Transactions
GET("/payment-transactions") or POST("/payment-transactions")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"filter":"boolean | required"
"more":"boolean | required"
"pageNumber": 1, // required
"batchNumber": 10, // required
"sort": "required", // ASC | DESC
"orderBy" :"required", // go to GET("/allowed-query/fields/payment-transactions") to see accepted fields
"groups": [{
"filterGroupCondition":"required" // AND | OR
"filterSearchCondition":"required" // AND | OR
"filters": [{
"filterOption": "eq",
"field": "", // go to GET("/allowed-query/fields/payment-transactions") to see accepted fields
"value": "user input",
"dataType": "string" // string | number | bool | date | dateTime
}]
}]
}
GET("/payment-transactions/details/:id")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
GET("/payment-transactions/create")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Request Body
{
"businessId": "required",
"customersId": "",
"status": "required",
"amount": "required",
"narration": "required",
"senderAccountNumber": "required",
"senderAccountName": "required",
"receiverAccountNumber": "required",
"receiverAccountName": "required"
}
Stats
GET("/stats/payment-gateway-dashboard/:businessId")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
GET("/stats/payment-link-dashboard/:businessId")
Request Header
{
"x-auth-token": "required" or "x-api-token": "required"
}
Deployment
Docker
Docker is a set of platform as a service products that use OS-level virtualization to deliver software in packages called containers. The service has both free and premium tiers. The software that hosts the containers is called Docker Engine.
VPS
VPS can stand for virtual private server, which is a type of hosting service that uses virtualization technology. VPSs are virtual machines that run their own operating system and have their own dedicated resources, including CPU, RAM, storage, and bandwidth.
NGINX
Nginx is a web server that can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache.
Dockerfile
A Dockerfile is a that contains instructions for building a Docker image. Docker images are used to create Docker containers, which are isolated, lightweight, and portable execution environments. Dockerfiles are made up of a series of commands, each of which tells Docker how to build the image. The commands are executed in order, and each one builds upon the previous one.
Docker Compose File
A Docker Compose file is a file that defines and runs multi-container Docker applications. With Compose, you can create a YAML file to define the services and networks for your application. Then, with a single command, you can create and start all the services from your configuration. To create a Docker Compose file, you need to define the services that make up your application. Each service is defined by a YAML block that specifies the image, ports, volumes, and other configuration options for the container.
CI/CD Pipline
The .gitlab-ci.yml file is a YAML file that defines project configuration in GitLab CI. It is placed at the root of the repository. The .gitlab-ci.yml file defines:
- Scripts that should run during the CI/CD pipeline
- Scheduling
- Additional configuration files and templates
- Dependencies
- Caches
- Commands GitLab should run sequentially or in parallel
- Instructions on where the application should be deployed to