Skip to main content

A Python library for generating QR codes for transactions compliant with the Bakong KHQR standard. (Unofficial NBC Library)

Project description

bakong-khqr

A Python library for generating QR codes for transactions compliant with the Bakong KHQR standard.

Installation

pip install bakong-khqr

Usage

The bakong-khqr package provides the KHQR class for generating QR code data for Bakong transactions.

Importing the Library

You can import the KHQR class from the package as follows:

from bakong_khqr import KHQR

Creating QR Code Data

To generate QR code data for a transaction, create an instance of the KHQR class and call the create_qr method with the required parameters.

Example:

from bakong_khqr import KHQR

# Create an instance of KHQR
khqr = KHQR()

# Generate QR code data for a transaction
qr_data = khqr.create_qr(
    bank_account='sothen_ban@wing',
    merchant_name='Sothen Ban',
    merchant_city='Phnom Penh',
    amount=1.00,
    currency='USD',
    store_label='Shop A',
    phone_number='85515605227',
    bill_number='TRX019283775',
    terminal_label='Buy Course'
)

# Print or use the generated QR code data
print(qr_data)
# Result: 00020101021229190015sothen_ban@wing520459995802KH5910Sothen Ban6010Phnom Penh99170013172309296559054011530384062550112TRX0192837750211855156052270306Shop A0710Buy Course63040D95

Parameters for create_qr Method

  • bank_account: The bank account associated with the transaction.
  • merchant_name: Name of the merchant.
  • merchant_city: City where the merchant is located.
  • amount: Amount to be transacted.
  • currency: Currency of the transaction (e.g., 'USD', 'KHR').
  • store_label: Label or name of the store.
  • phone_number: Contact phone number.
  • bill_number: Reference number for the bill.
  • terminal_label: Label for the terminal.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Contributing

If you would like to contribute to this project, please fork the repository and submit a pull request.

Contact

For any questions or feedback, you can contact ME.

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

bakong-khqr-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

bakong_khqr-0.1.0-py3-none-any.whl (12.9 kB view details)

Uploaded Python 3

File details

Details for the file bakong-khqr-0.1.0.tar.gz.

File metadata

  • Download URL: bakong-khqr-0.1.0.tar.gz
  • Upload date:
  • Size: 9.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for bakong-khqr-0.1.0.tar.gz
Algorithm Hash digest
SHA256 f6ad8d1ceb044769a9e63e00d1c1940a98c9af0ee21558b8c9624ddfc9ac3de3
MD5 29909cf3fac9736077ce1090186fc917
BLAKE2b-256 be5019b8ef456f7c43c5b9271606a68b047b812da7c1e3557025c67c2b058dbe

See more details on using hashes here.

File details

Details for the file bakong_khqr-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: bakong_khqr-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 12.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.1

File hashes

Hashes for bakong_khqr-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8dc7d884315868ec88447686c68f55de1f6005afaa6c427fce1f54d7b86a549d
MD5 265adb83436ff071e37cb8414edb302c
BLAKE2b-256 5926f4ded747a8c99af2fadbda6f088e0dba0c14dec4315af95614f5f33885ce

See more details on using hashes here.

Supported by

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