This project has the following modules:
atm-driver
: It provides the connection with the atms and sends the authorization to an ISO switch or authorizer.iso-server-simulator
: An ISO authorizer simulator that has hardcoded return parameters.atm-driver-web
: Web services to manage atm-driver.
You can override the database parameters in a local.porperties
file, the default configuration will use devel.properties
values, but you can override any or all of them:
dbname=atm_driver
dbhost=localhost
dbport=3306
dbuser=jpos
dbpass=password
CREATE USER 'jpos'@'%' IDENTIFIED BY 'password';
CREATE USER 'jpos'@'localhost' IDENTIFIED BY 'password';
CREATE DATABASE atm_driver;
GRANT ALL PRIVILEGES ON atm_driver.* TO 'jpos'@'%' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON atm_driver.* TO 'jpos'@'localhost' WITH GRANT OPTION;
We use flywaydb
to version the database, you can update the database structure and needed data, by performing:
gradle :modules:atm-driver:flywayInfo # or fI for short, this will tell what migrations need to be applied or give an error if something wrong.
gradle :modules:atm-driver:flywayMigrate # or fM for short, this applies the migrations
During building all terms of the form @xxx@
in text files under src/dist
will be replaced by xxx
property value in devel.properties
or the overriden value in local.properties
.
You can pass -Ptarget=yyy
to gradle command if you want properties to be loaded from yyy.properties
file instead of devel.properties
.
For instance in db.propeties
:
hibernate.connection.username=@dbuser@
hibernate.connection.password=@dbpass@
...
hibernate.connection.url=jdbc:mysql://@dbhost@:@dbport@/@dbname@?autoReconnect=true
They are also used in flyway migrations in another way (see modules/atm-driver/build.gradle
):
flyway {
def tcfg= targetConfiguration
url= "jdbc:mysql://${tcfg.dbhost}:${tcfg.dbport}/${tcfg.dbname}"
user= tcfg.dbuser
password= tcfg.dbpass
Where taretConfiguration
map is filled from the target.properties
selected in -Ptarget=...
gradle eclipse
gradle idea
gradle jar
gradle version
gradle dist
This creates a tar gzipped file in the build/distributions
directory.
gradle installApp
Installs application in build/install
with everything you need to run jPOS. Once the directory is created, you can cd build/install
and call java -jar your-project-version.jar
or the bin/q2
(or q2.bat
) script available in the bin
directory.
gradle publish
gradle tasks
For testing the driver you need to, at least, run the driver itself along with the atm emulator and the iso-server-simultor
module.
To start the iso-server-simulator
:
cd modules/iso-server-simulator
gradle iA #short for installApp
build/install/iso-server-simulator/bin/q2
To start the atm driver itself:
cd modules/atm-driver
gradle iA
build/install/atm-driver/bin/q2
For the ATM emulator, clone alectron-atm repo and then:
- In the cloned directorio run
./install.sh
to perform a custom install. - To start it just run
npm start