Skip to content

Latest commit

 

History

History
94 lines (73 loc) · 1.49 KB

README.md

File metadata and controls

94 lines (73 loc) · 1.49 KB

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

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:

cp .env.example .env
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
Replace 1.pem , 2.pem , 3.pem , privat.pem under certificates & privates folder

Install dependencies

pipenv install

Run migrations

python manage.py migrate

Run server

python manage.py runserver

Requests

Place order example

POST http://127.0.0.1:8000/api/orders/
{
    "id": 100,
    "idno": "2",
    "title": "Company"
}

Parse received XML

POST http://127.0.0.1:8000/api/parsers/xml/
{
    "idno": "2",
    "xml": "<xml/>"
}

Generate parsed XML BIC - PDF

GET http://127.0.0.1:8000/api/parsers/1/