A reusable Django app for integration with BaroBill services.
Project description
Django Barobill
바로빌 연동을 위한 reusable package
설치
아래 명령어로 패키지 설치한 후
pip install django-barobill
django의 settings.py 내 INSTALLED_APPS에 django_barobill을 추가합니다.
INSTALLED_APPS = [
...
'django.contrib.staticfiles',
'django_barobill'
]
마지막으로 마이그레이션을 수행하여 필요한 테이블을 생성합니다.
python manage.py migrate
구성
파트너
이 패키지는 기본적으로 여러개의 파트너사를 한 앱에서 관리할 수 있게 구성되어 있습니다.
파트너사는 models.Partner에 저장되며 신규 파트너를 아래와 같이 등록할 수 있습니다.
from django_barobill.models import Partner
상세 학목은 메서드의 docstring 참고
partner = Partner.objects.register_partner(
'회사명', '사업자등록번호', 'api key', 'userid', dev=False
)
계좌조회
계좌조회 관련 client
아래와 같이 은행 계좌 조회와 관련된 client를 생성한다.
from django_barobill.models import Partner
partner = Partner.objects.first()
bank_client = partner.bank.client
계좌 등록
생성된 client에서 아래와 같이 계좌를 생성한다. 상세 학목은 메서드의 docstring 참고
bank_account = bank_client.register_bank_account(
'수금계좌', BankAccountCollectCycle.MINUTE10, BankAccountBank.HANA,
BankAccountAccountType.C, '21223451241', '1234'
)
계좌 거래내역
조회만
아래와 같은 형태로 거래내역을 조회힌다. 응답은 barobill의 응답을 변경없이 반환한다. 자세한 내용은 각 메서드의 docstring 참고
# 기간 조회
log_duration = bank_client.get_log('20240101', '20240105', 1)
# 특정일 조회
log_day = bank_client.get_daily_log('20240101', 1)
# 특정월 조회
log_month = bank_client.get_monthly_log('202401', 1)
조회 및 데이터베이스 등록
조회 후 데이터베이스 등록 까지 진행 자세한 내용은 각 메서드의 docstring 참고
# 특정일 조회 및 등록
log_day = bank_client.update_date_log('20240101')
# 오늘 조회 및 등록
log_today = bank_client.update_today_log()
# 어제 조회 및 등록
log_yesterday = bank_client.update_yesterday_log()
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_barobill-0.1.1.tar.gz.
File metadata
- Download URL: django_barobill-0.1.1.tar.gz
- Upload date:
- Size: 12.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a26925fecfa7fabb79ea9e195471a50d7a78e324937cd21cf41ea0d5a0845026
|
|
| MD5 |
7b631f2eea08f4822d546d21c40c1452
|
|
| BLAKE2b-256 |
716a46e01e0411dcf6c617ac6f557ae008c1b574ac5df63b7ba4a17e01cc2ec8
|
File details
Details for the file django_barobill-0.1.1-py3-none-any.whl.
File metadata
- Download URL: django_barobill-0.1.1-py3-none-any.whl
- Upload date:
- Size: 13.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d1e3550b6fdab24cd2c1d71bca5d45dbf0e807d0ec1fc560d110dbbf0dca130
|
|
| MD5 |
ba20164a7d34e9266f713164ea68ba4f
|
|
| BLAKE2b-256 |
07f75aa0010a07ea27ef5784516a19596c23b005538f36b3db0b3c65e59e14d0
|