Projeto para simulação de rotinas de pagamentos de uma processadora de crédito.
POST http://localhost:8080/rotina-pagamento/v1/accounts
{
"available_credit_limit": {
"amount": 500.0
},
"available_withdrawal_limit": {
"amount": 500.0
}
}
Resposta:
{
"account_id": 1,
"available_credit_limit": {
"amount": 500.0
},
"available_withdrawal_limit": {
"amount": 500.0
}
}
PATCH http://localhost:8080/rotina-pagamento/v1/accounts/{account_id}
{
"available_credit_limit": {
"amount": 100.0
},
"available_withdrawal_limit": {
"amount" : 100.0
}
}
Resposta:
{
"account_id": 0,
"available_credit_limit": {
"amount": 100.0
},
"available_withdrawal_limit": {
"amount": 100.0
}
}
Obs: Enviar um dos limites com um valor negativo, irá subtrair do limite da conta.
GET http://localhost:8080/rotina-pagamento/v1/accounts/limits
Resposta:
[
{
"account_id": 0,
"available_credit_limit": {
"amount": 0
},
"available_withdrawal_limit": {
"amount": 0
}
}
]
GET http://localhost:8080/rotina-pagamento/v1/transactions
Resposta:
[
{
"amount": 0.0,
"balance": 0.0,
"transaction_id": 0,
"account_id": 0,
"operation_type_id": 0,
"event_date": null,
"due_date": null
}
]
GET http://localhost:8080/rotina-pagamento/v1/transactions/{id}
Resposta:
{
"amount": 0.0,
"balance": 0.0,
"transaction_id": 0,
"account_id": 0,
"operation_type_id": 0,
"event_date": null,
"due_date": null
}
GET http://localhost:8080/rotina-pagamento/v1/transactions/account/{account_id}
Resposta:
[
{
"amount": 0.0,
"balance": 0.0,
"transaction_id": 0,
"account_id": 0,
"operation_type_id": 0,
"event_date": null,
"due_date": null
},
{
"amount": 0.0,
"balance": 0.0,
"transaction_id": 0,
"account_id": 0,
"operation_type_id": 0,
"event_date": null,
"due_date": null
}
]
POST http://localhost:8080/rotina-pagamento/v1/transactions
{
"account_id": 0,
"operation_type_id": 0,
"amount": 0
}
Resposta:
{
"transaction_id": 0,
"account_id": 0,
"operation_type_id": 0,
"amount": 0,
"balance": 0,
"event_date": 0,
"due_date": 0
}
Obs: Não é permitido informar um valor negativo para o campo 'amount'.
POST http://localhost:8080/rotina-pagamento/v1/payments
[
{
"account_id": 0,
"amount": 0
},
{
"account_id": 0,
"amount": 0
}
]
Resposta:
[
{
"amount": 0,
"balance": 0,
"transaction_id": 0,
"account_id": 0,
"operation_type_id": 0,
"event_date": null,
"due_date": null
}
]
Obs: Não é permitido cadastrar um pagamento para uma conta que não possua contas a pagar, caso algum dos pagamentos informados na requisição quebre essa regra, ele será ignorado sem impedir que os demais sejam efetuados.
A tabela abaixo lista os tipos de operações possíveis para realização de transações.
operation_type_id | descrição |
---|---|
1 | COMPRA À VISTA |
2 | COMPRA PARCELADA |
3 | SAQUE |
4 | PAGAMENTO |
- Java 8
- Maven 3
- Docker
- Docker-Compose
- Swagger
> git clone https://github.com/rafaelDuarte100/rotina-pagamento.git
> cd rotina-pagamento/pagamento/
> docker-compose up
> git clone https://github.com/rafaelDuarte100/rotina-pagamento.git
> cd rotina-pagamento/pagamento/
> mvn test
- Com a aplicação rodando acesse: http://localhost:8080/rotina-pagamento/v1/swagger-ui.html
- Rafael Duarte de Oliveira - Developer - rafaelduarte100@gmail.com