Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/timgabets/lakgves

Application for testing Issuer Bank credit card processing systems (ISO8583, Visa, Mastercard)
https://github.com/timgabets/lakgves

Last synced: 9 days ago
JSON representation

Application for testing Issuer Bank credit card processing systems (ISO8583, Visa, Mastercard)

Awesome Lists containing this project

README

        

## LAKGVES
[![Build Status](https://travis-ci.org/timgabets/lakgves.svg?branch=master)](https://travis-ci.org/timgabets/lakgves)
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)

lak·ves
1. dextral muscles around the eyes, in particular the temporal lobes of the chin and lower lip. (*"the lakgves of other vertebrates"*)
2. [a word that does not exist](https://l.thisworddoesnotexist.com/Wvn4); it was invented, defined and used by a machine learning algorithm.

### Concept

HTTP to [ISO8583](https://en.wikipedia.org/wiki/ISO_8583) message converter, written from scratch in Rust and heavily inspired by [JUKS' socket queue](https://github.com/juks/iso-8583-socket-queue). The main purpose of the system is testing Issuer Bank systems.

+-----------------+ +--------------------+
| | <------ XML ISO 8583 ------> | Issuer Bank |
HTTP client <--- JSON ---> | Lakgves | <--- TODO (VISA SMS/DMS) --> | Authorization |
| | <--- TODO (Mastercard) ---> | Host |
+--------+--------+ +--------------------+
| +--------------------+
| | Issuer Bank |
+-- SP XML --> | Anti-Fraud |
| System |
+--------------------+

The application converts JSON payload to ISO8583 message in a proper format, sends it to the Bank host, receives the response and sends it back to the HTTP client.
In other words, the input JSON like this (note that the card number in i002 and expiration date in i014 are masked here for security reasons. The real request should contain the full unmacked data):
```json
{
"i000":"0100",
"i002":"443322******0961",
"i003":"300000",
"i004":"000000000000",
"i014":"****",
"i018":"6011",
"i022":"0100",
"i023":"000",
"i025":"02",
"i026":"04",
"i032":"999999",
"i041":"TERMID01",
"i042":"IDDQD MERCH ID",
"i043":"IDDQD AM. 341215574 341215574 MSKRU",
"i049":"643",
"i053":"9801100001000000"
}
```
will be converted into one of the [ISO8583](https://en.wikipedia.org/wiki/ISO_8583) flavours (e.g. Debit Host Interface XML in the example below):
```xml


0100
443322******0961
300000
000000000000
0505151908
367298
151908
0505
****
6011
0100
000
02
04
999999
964800787298
TERMID01
IDDQD MERCH ID
IDDQD AM. 341215574 341215574 MSKRU
643
9801100001000000

```

Please refer to your [ISO8583](https://en.wikipedia.org/wiki/ISO_8583) specification for the fields meaning and possible values.

### Supported formats
The list of supported formats:
* [TSYS DHI (Device Host Interface) XML](https://github.com/timgabets/dhi-xml)
* [IBM Safer Payments XML](https://github.com/timgabets/sp-xml)

### Installation
#### Red Hat/Fedora:
Quick install:
```bash
curl -s https://packagecloud.io/install/repositories/timgabets/lakgves/script.rpm.sh | sudo bash
sudo yum install lakgves
```

### Running
Start app as a service:
```bash
sudo systemctl start lakgves
sudo systemctl status lakgves
```

The application logs may be retrived by journalctl:
```
journalctl -u lakgves
```

Alternatively, execute application manually:
```bash
# Edit configuration file /etc/lakgves/config.toml and then run
/usr/bin/lakgves /etc/lakgves/config.toml
```

### Usage
Any HTTP tool (e.g. [curl](https://curl.haxx.se/) or [SoapUI](https://www.soapui.org/)) may be used to interact with the Lakgves app:
```
curl -v --header "Content-Type: application/json" --request POST --data '{"i000":"0100", "i002":"443322******0961", "i003":"300000", "i004":"000000000000", "i014":"****", "i018":"6011", "i022":"0100", "i023":"000", "i025":"02", "i026":"04", "i032":"999999", "i041":"TERMID01", "i042":"IDDQD MERCH ID", "i043":"IDDQD AM. 341215574 341215574 MSKRU", "i049":"643", "i053":"9801100001000000"}' localhost:8080
```
The received response may look like this:
```
< HTTP/1.1 200 OK
< content-length: 528
< content-type: application/json
< x-hdr: sample
< date: Tue, 05 May 2020 15:01:52 GMT
<
* Connection #0 to host localhost left intact
{"i000":"0110","i002":"443322******0961","i003":"300000","i004":"000000000000","i007":"0505180152","i011":"233005","i012":"180152","i013":"0505","i014":"****","i018":"6011","i022":"0100","i023":"000","i025":"02","i026":"4","i032":"999999","i037":"634538143910","i038":"082673","i039":"00","i041":"TERMID01","i042":"IDDQD MERCH ID","i043":"IDDQD AM. 341215574 341215574 MSKRU","i049":"643","i053":"9801100001000000","i054":"0001643D000001431065","i096":"0000634538143910","i120":"UD038IR0044444CR009ES0048100IA0103510301943"}* Closing connection 0
curl -v --header "Content-Type: application/json" --request POST --data
```