Skip to content

Mrthnx/serveless-tokenizacion-tarjetas

Repository files navigation

Serverless-challenge

Instalaciones necesarias

sudo apt install aws-sdk
sudo apt install serverless
npm install serverless-offline -g


Configurar variables de entorno para AWS

https://www.serverless.com/framework/docs/providers/aws/guide/credentials/


Configurar variables de entorno para la BD

export REDIS_HOST=127.0.0.1
export REDIS_PORT=6379
export PRIVATE_KEY=my_private_key


Levantar proyecto offline

npm run invoke:offline


Test

npm run test


Deployar

npm run deploy


API

todo peticion debe tener el header x-private-key con el valor asignado anteriormente

URL Obtener data de token

GET token/{tokenId} Response

{
	"email": "[email protected]",
	"card_number": 111111111111111,
	"expiration_month": "6",
	"expiration_year": "2023"
}

URL Crear data de token

POST /token
todos los campos son requeridos

Parámetros de solicitud

{
	"email": "[email protected]",
	"card_number": 111111111111111,
	"cvv": 123,
	"expiration_month": "6",
	"expiration_year": "2023"
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published