Skip to content

NaraSakamoto/cashier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cashier

Cashier is a simple system that process boleto and credit card payments by API or checkout page.

Techs

Cashier uses a number of open source projects to work properly:

  • Maven - Build management tool
  • Java 8 - Programming language.
  • spring-boot - Framework that makes it easy to create a Spring Framework based application.
  • PostgreSQL - Object-relational database system.
  • Liquibase - Library for creating, managing and applying database schema changes.
  • Freemarker - Java template engine. Creates the HTML.
  • Bootstrap - Front-end framework for creating user interface components.
  • Swagger - Framework for describing the API

Installation

Cashier requires Java 8+, Maven 3+ and a postgres database to run.

Create a database named 'cashier' with an owner that the login role is 'cashier' and the password is 'cashier'.

$ CREATE ROLE cashier LOGIN ENCRYPTED PASSWORD 'md59825ef00c46fc8e97ba078ef6b3c6f8a'
$ CREATE DATABASE cashier WITH OWNER = cashier;

Generate the .jar file compiling application with maven.

$ cd ${project location}/cashier
$ mvn package

Run the project with java. It will be available on port 8080

$ cd ${project location}/cashier/target
$ java -jar cashier-0.0.1-SNAPSHOT.jar

Creating payments

There are two ways for create a payment. You can use the API and make a POST request with a JSON or use the checkout page.

Using API

Details on http://localhost:8080/swagger-ui.html

Create a POST request using a JSON with payment information. You can use the clients that are already created on database, clients with id 1 or id 2.

URL: http://localhost:8080/api/payments

{
  "buyer": {
    "cpf": 26576589634,
    "email": "[email protected]",
    "name": "Nara Sakamoto"
  },
  "client": {
    "id": 1
  },
  "payment": {
    "amount": 100.0,
    "card": {
      "cvv": 123,
      "expirationDate": "2018-03-03",
      "holderName": "NUBANK",
      "number": 123456789
    },
    "type": "CREDIT_CARD"
  }
}

Using checkout page

You can access the checkout page by:

Todos

  • Write MORE Tests
  • Improve the checkout page creating validations and masks for the fields
  • Use docker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages