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