Skip to main content

A reusable Django app for integration with BaroBill services.

Project description

Django Barobill

바로빌 연동을 위한 reusable package

설치

아래 명령어로 패키지 설치한 후

pip install django-barobill

djangosettings.pyINSTALLED_APPSdjango_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

django_barobill-0.1.3.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_barobill-0.1.3-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file django_barobill-0.1.3.tar.gz.

File metadata

  • Download URL: django_barobill-0.1.3.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.0

File hashes

Hashes for django_barobill-0.1.3.tar.gz
Algorithm Hash digest
SHA256 06c9d20b631227e0abeb21aa533c211d7a3c9a349260ddb65599a11165a0fb31
MD5 f733419cebd56ae61539890736475e95
BLAKE2b-256 7e8b18424e4fbbcb824142fca5b9f0cbaf36044e0239533ba88a880d6b1584d4

See more details on using hashes here.

File details

Details for the file django_barobill-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for django_barobill-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c15c175bdce2a2550291a1ebfaf0c2cfe029a87a61eb260a1194b93bf36023b4
MD5 4b16fbac0fdeae86e8de4168f19beac2
BLAKE2b-256 bf1299a0f71dc3d920d23f4f49f1c2d3c9aaebd8e50f7251e07aa01e53d6a1b4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page