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 hashes)
Built Distribution
Close
Hashes for napas_qr_python-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0454756cdabcadd7f7373ea7f8f4af0fca9089099b3693faad953a58e9ba3620 |
|
MD5 | b94d4278d5b2d8fcc45e94fc8c0759b1 |
|
BLAKE2b-256 | a2443e38c91a86e41ab93d0314751551c5b9b2e05cc695b7270899fc75442ab3 |