Skip to content

This is my 18th project in Driven Education, a benefit card API. The API is responsible for creating, reloading, activating, as well as processing purchases.

Notifications You must be signed in to change notification settings

thalesgomest/valex-back

Repository files navigation

📑 Contents

📌 Project Description

This is a benefit card API. The API is responsible for creating, reloading, activating, as well as processing all purchases of the card.

🚧 Status of work

status

⚙️ How to run

# Clone this repoository
$ git clone https://github.com/thalesgomest/valex-back.git

# Change to project directory
$ cd valex-back

# Install all dependencies
$ npm install

# Run the project with
$ npm run dev

📮 API Documentation

Route to create a new card

POST /card/create

Headers Type Description
x-api-key string adKLNx.DzvOVjQH01TumGl2urPjPQSxUbf67vs0
Body Type Description
employeeId number Required → employee Id
cardType enum Required → Transaction Type
TransactionTypes
groceries
restaurant
transport
education
health

Response:

{
	"number": "4747 7552 7052 6823",
	"cardholderName": "CICLANA M MADEIRA",
	"expirationDate": "07/27",
	"securityCode": "398"
}

❗ Use the response data of the route /card/create for test the below endpoints ⤵️

Route to active a card

POST /card/create
Body Type Description
number string Required → card number
cardholderName string Required → cardholder name
expirationDate string Required → card expiration date
securityCode string Required → card securityCode
password string Required → card password

Route to block a card

PUT /card/block
Body Type Description
number string Required → card number
cardholderName string Required → cardholder name
expirationDate string Required → card expiration date
password string Required → card password

Route to unblock a card

PUT /card/unblock
Body Type Description
number string Required → card number
cardholderName string Required → cardholder name
expirationDate string Required → card expiration date
password string Required → card password

Route to get card's statement

GET /card/statement
Body Type Description
number string Required → card number
cardholderName string Required → cardholder name
expirationDate string Required → card expiration date

Route to get do a card recharge

POST /card/recharge
Headers Type Description
x-api-key string adKLNx.DzvOVjQH01TumGl2urPjPQSxUbf67vs0
Body Type Description
number string Required → card number
cardholderName string Required → cardholder name
expirationDate string Required → card expiration date
amount number Required → recharge amount

Route to do a payment with a card in a POS (Point of Sale)

POST /card/payment/:businessId
Body Type Description
number string Required → card number
cardholderName string Required → cardholder name
expirationDate string Required → card expiration date
password string Required → card password
amount number Required → payment amount

🛠️ Build with

uses-node js npm express postgreSQL heroku typescript built-with-git built-with-vsc

📫 Contact

About

This is my 18th project in Driven Education, a benefit card API. The API is responsible for creating, reloading, activating, as well as processing purchases.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published