Skip to content

Subscribe project that notifies that an order has been released and is ready for use.

Notifications You must be signed in to change notification settings

diogoalbuquerque/notification-partner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⚙️ notification-partner

Build codecov

Project

This project consists of a payment notification queue. When a payment for an order is successfully made, an object is placed in the queue for processing and sending the notification to the partner.

The flow starts when an order is paid.

After payment of the order, another system will send the number of the paid order to the queue.

When the order is added to the queue, this function will start.

  • Each added order will have its existence verified in the customer order table;
  • Then a notification will be sent to the partner's api informing that the order has been released and is ready to be used.

Usage

Requires an sqs object to start.

Technologies used

This function was built using the following technologies:

Technical operation

How to install

Main variables to be defined

Variable Variable description Default value
LOG_LEVEL Log level. info
MYSQL_OPEN_CONN_MAX Maximum number of connections that can be opened. 100
MYSQL_IDLE_CONN_MAX Maximum number of connections that can be stopped. 2
MYSQL_LIFE_CONN_MAX Maximum connection time in seconds. 10
AWS_REGION_NAME Region where the secrets manager is located. DEFINE_REGION_NAME
SECRETS_MANAGER Name of the secret manager used in the application SECRETS_MANAGER
RC_CLIENT_TIMEOUT Default timeout for http client. 30
PARTNER_API_KEY Authorization key for partner api. Key cmlvY2FyZHJvdXRlcjpHdXZHTUNHM3
PARTNER_URL Partner notification address. https://hmg-cs.mock.ai/api/Recharge/pix-payment

Project build:

To upload a function you need to create and build it like linux operating. So use the following command in the project folder:

$ GOOS=linux GOARCH=amd64 go build -o SUB_NOTIFIER ./

or you can use Makefile.

$ make build

❗ Attention️

  • After the build, you need to create the .zip of the generated file and then upload this .zip file;
  • The Handler is the name of the generated .zip file.

Comments

  • This project is a part of a proof of concept used in the company, so parts of them were omitted as well as domain and data model information.

About

Subscribe project that notifies that an order has been released and is ready for use.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published