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.2.tar.gz
(9.7 kB
view details)
Built Distribution
File details
Details for the file napas_qr_python-0.1.2.tar.gz
.
File metadata
- Download URL: napas_qr_python-0.1.2.tar.gz
- Upload date:
- Size: 9.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a5e875b6ced0cc101bc4d45fe2b376d2e8b14d919a0dd67c9ae2cbc9b7871346 |
|
MD5 | 59251eb12bdcc9e52ef7b2e45173e5bd |
|
BLAKE2b-256 | d55213cd04118629e3916b7e7f08241a92175e1fbe345ac6f7e9ef9c1ea30eec |
File details
Details for the file napas_qr_python-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: napas_qr_python-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0454756cdabcadd7f7373ea7f8f4af0fca9089099b3693faad953a58e9ba3620 |
|
MD5 | b94d4278d5b2d8fcc45e94fc8c0759b1 |
|
BLAKE2b-256 | a2443e38c91a86e41ab93d0314751551c5b9b2e05cc695b7270899fc75442ab3 |