VietQR for python.
Project description
Napas QR Python
Generate VietQR for python following VietQR Vi Version and En Version
- Documentation: https://shinxz12.github.io/napas-qr-python
- GitHub: https://github.com/shinxz12/napas-qr-python
- PyPI: https://pypi.org/project/napas-qr-python/
- Free software: MIT
Features
- VietQR code encoder.
- Using segno for QR generator.
Parameters
Field | Mandatory | Default Value | Description |
---|---|---|---|
bin_id | Yes | None | BIN ID |
consumer_id | Yes | None | Card/Account ID |
service_code | Yes | "ACCOUNT" | "PAYMENT", "CASH_WITHDRAWL", "CARD", "ACCOUNT" |
transaction_amount | No | None | Amount |
purpose_of_transaction. | No | None | Message |
point_of_initiation_method | Yes | "DYNAMIC" | "DYNAMIC" OR "STATIC" |
transaction_currency | Yes | 704(VND) | currency |
bill_number | No | None | Bill number |
mobile_number | No | None | Mobile Number |
store_label | No | None | Store Label |
reference_label | No | None | Reference Label |
customer_label | No | None | Customer Label |
Please read more in the VietQR docs.
Example
- Generate code with base informations and an account service:
from qr_pay import QRPay
qr_pay = QRPay('970436', '1031933430', purpose_of_transaction="Thanh toan hoa don")
code = qr_pay.code
# 00020101021153037045802VN38540010A00000072701240006970436011010319334300208QRIBFTTA62220818Thanh toan hoa don6304FCE9
# Generate QR code
qr_pay.generate_qr_pay()
- Generate code with a card service and amount:
data = {
"bin_id": "970436",
"consumer_id": "9704368625581601018",
"service_code": "CARD",
"transaction_amount": 2000000
}
qr_pay = QRPay(**data)
code = qr_pay.code
# 0002010102115303704540720000005802VN38630010A00000072701330006970436011997043686255816010180208QRIBFTTC63045FCF
qr_pay.generate_qr_pay()
- Generate QR code with custom styles following segno:
qr_pay = QRPay('970436', '1031933430')
# Code: 0002010102115303704540720000005802VN38630010A00000072701330006970436011997043686255816010180208QRIBFTTC63045FCF
styles = { "scale": 2, "dark": "darkblue"}
dist = "qr_code_style.png"
qr_pay.generate_qr_pay(dist=dist, styles=styles)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
napas_qr_python-0.1.0.tar.gz
(9.6 kB
view hashes)
Built Distribution
Close
Hashes for napas_qr_python-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c74a44148fb5e0fb9a01995e7e32e23bd8ad47164c989d1b76390459ff2cece8 |
|
MD5 | eb178f7f340bdce0d35870574382de6a |
|
BLAKE2b-256 | 115e18f98453a76526cb151597de41d934f198b0539938ab3f2254f88f5511e2 |