Api for payments
- Payment by bank transfer
- Payment by credit card
Only card types (uppercase and format) are allowed:
-
VISA,
-
MASTERCARD,
-
AMERICANEXPRESS,
-
DINERSCLUB
-
JCB
-
Credit card type must be valid.
-
Does not accept card expired.
-
CVV must be valid.
-
All json values (of ticket or credit card) must be filled.
- JavaScript
- Node.js
npm install
- On the terminal open the server folder inside the project root. And run:
npm installfor installation of tdd mocha tests.
- On the terminal open the server folder inside the project root. And run:
2.npm test
- On the terminal open the server folder inside the project root. And run:
node app.js
body:
{
"amount": 200,
"buyer": {
"name": "ariadni",
"email": "ariadni@gmail.com",
"cpf": "02842054008"
},
"card" : {
"cardType" : "VISA" ,
"number" : "4111111111111111" ,
"expiryMonth" : "03" ,
"expiryYear" : "2100" ,
"cvv" : "123"
}
}http status: 200
response body:
{
"success": true
}http status: 404....
response body:
{
"message": "validation error"
}body:
{
"amount": 200,
"buyer": {
"name": "ariadni",
"email": "ariadni@gmail.com",
"cpf": "02842054008"
}
}http status: 200
response body:
{
"barcode": "321321312.321312312.312321.321.321.321.32.13.21"
}