Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ebs-integrator/bic-reporting-api

BIC Reporting Implementation in Python 3.8 with DRF
https://github.com/ebs-integrator/bic-reporting-api

api bic django-rest-framework drf python3 rest-api xml

Last synced: 4 months ago
JSON representation

BIC Reporting Implementation in Python 3.8 with DRF

Awesome Lists containing this project

README

        

# BIC Reporting API

BIC (Biroul Istoriilor de Credit) `bicr.md` Reporting API Implementation

## Process

1. Generate BIC XML
2. Sign XML at itsec.md
3. Receive signed XML
4. Send xml & signature to BIC to receive company report

Understanding logic , core
```sh
applications/reports/process

Check ProcessService for better understanding
applications/reports/process/__init__.py
```

## Requirements

1. Python 3.8

## Installation

Before running this project you should have certificates from `bicr.md` and signing domain from `itsec.md` , at the moment those are:
```
1.pem (CHAIN)
2.pem (CA)
3.pem (KEY)
private.pem (user certificate)
```

Setup .env:
```sh
cp .env.example .env
```

```sh
SERVICE_BIC_HOST=http://sigun.bicr.md/api/bulkReport2/
SERVICE_BIC_USERNAME=test
SERVICE_BIC_PASSWORD=test

SERVICE_SIGNATURE_HOST=
SERVICE_SIGNATURE_CERTIFICATES=certificates
SERVICE_SIGNATURE_TEMPLATES=templates
SERVICE_SIGNATURE_PRIVATES=privates
```

```sh
Replace 1.pem , 2.pem , 3.pem , privat.pem under certificates & privates folder
```

Install dependencies
```sh
pipenv install
```

Run migrations
```sh
python manage.py migrate
```

Run server
```sh
python manage.py runserver
```

## Requests

Place order example
```sh
POST http://127.0.0.1:8000/api/orders/
{
"id": 100,
"idno": "2",
"title": "Company"
}
```
Parse received XML
```sh
POST http://127.0.0.1:8000/api/parsers/xml/
{
"idno": "2",
"xml": ""
}
```
Generate parsed XML `BIC - PDF`
```sh
GET http://127.0.0.1:8000/api/parsers/1/
```