Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
o-niko committed Feb 17, 2020
2 parents b013e73 + 4cb612c commit c42d8f4
Showing 1 changed file with 86 additions and 0 deletions.
86 changes: 86 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# payment-api
This is a sample project used only for recruitment purposes.

### Running Locally
Download the repository to your computer

Open your terminal and run the following command on the project's root folder
```
./mvnw spring-boot:run
```

You should see a success message like this
```
Started PaymentsApiApplication in 5.196 seconds (JVM running for 5.684)
```

### API Operations

* The main operations are:

#### 1: Registering a new Buyer: `POST (http://localhost:9000/buyer)` Please, notice that for insertion purposes, the id is not required, for it is
auto-incremented in database.

```json
{
"email": "[email protected]",
"cpf": "123123123123",
"nome": "buyer"
}
```

#### 2: Registering a new Client: `POST (http://localhost:9000/client)`

```json
{
"name": "amazon"
}
```

#### 3: Creating a new Payment with CREDIT_CARD option: `POST (http://localhost:9000/payment)`

```json
{
"amount": "10000.00",
"paymentMethod":{
"method": "CREDIT_CARD",
"creditCard":{
"brand": "Master",
"holder":{
"name": "Bia",
"birthDate": "28-10-1994",
"documentNumber": "38129391293"
},
"cardNumber": "1111111111111215",
"expirationDate": "30-04-2018",
"cvv": "235"
}
},
"buyer":{
"id": "1"
},
"client":{
"id": "1"
}
}
```

#### 4: Creating a new Payment with BOLETO option: `POST (http://localhost:9000/payment)`
```json
{
"amount": "10000.00",
"paymentMethod":{
"method": "BOLETO"
},
"buyer":{
"id": "1"
},
"client":{
"id": "1"
}
}
```

#### 5: Retrieving information of a payment by its id: `GET (http://localhost:9000/payment/{id})`

#### 6: Retrieving information of a buyer by its id: `GET (http://localhost:9000/buyer/{id})`

0 comments on commit c42d8f4

Please sign in to comment.