This is the VietQR library which help to generate the VietQR Data String, which align with VietQR specifications. (The current VietQR Specification was announced by Napas on 21 Apr 2021)
Project description
VietQR Generation Library
This is a VietQR generation library.
This library will help you to generate the VietQR Data String which align with VietQR Specification announced on 05/10/2022
VietQR Library specification:
- Generation function:
VietQR.genQRString(is_dynamic_qr, merchant_category, merchant_name, merchant_city, postal_code, currency, country_code, amount, acq, merchant_id, service_code, bill_number, mobile_number, store_label, loyalty_number, ref_label, customer_label, terminal_label, purpose_txn, additional_data, lang_ref, local_merchant_name, local_merchant_city, uuid, ipn_url, app_package_name)
- The detail variables:
is_dynamic_qr
:- 'False' for static QR
- 'True' for dynamic QR
merchant_category
: defined by ISO 18245 and assigned by Payment Instituation.postal_code
: Postal code, Ex: postcode = 70000 for Vietnamcurrency
: defined by ISO 4217, for Vietnam:currency = 704
country_code
: defined by ISO ISO 3166-1 alpha 2, for Vietnam:country_code = VN
amount
: Total amount (including TIP) of billacq
: Acquirer bank code defined by Vietname State Bank.service_code
: VietQR service code as followingQRPUSH
: Payment service code by QRQRIBFTTC
: Inter-Bank Fund Transfer 24/7 to Card service code by QRQRIBFTTA
: Inter-Bank Fund Transfer 24/7 to Account service code by QR
merchant_id
: as following- for QRPUSH: Merchant ID will be provided by Acquirer bank.
- for QRIBFTTC: Merchant ID will be your ATM card number which started with '9704...'.
- for QRIBFTTA: Merchant ID will be your bank account.
purpose_txn
: payment/transfer purpose- Other extended and optional variable
bill_number
: Your bill numberterminal_label
: Your terminal IDstore_label
: Your store namemobile_number
: Your customer mobile phonenumberloyalty_number
: Your customer loyalty numbeercustomer_label
: Your customer IDref_label
: Your reference info
To use this library, do as following
-
Import the library:
from vietqrlib import VietQR
-
Generate the VietQR data string:
- Example for money transfer VietQR:
vietQRString = VietQR.genQRString(merchant_id="660704060000129", acq=VietQR.getBincode('VIB'), amount="50000", service_code="QRIBFTTA", ipn_url="abc" )
print(f"{vietQRString}")
- The result: 00020101021238590010A0000007270141000697044101156607040600001290208QRIBFTTA5204581253037045405500005802VN5901_6011HO CHI MINH99210010A0000007270203abc63045859
- Then you can use any QRcode library to generate the VietQR and the result as following:
Supporting
- Any questions please send us a comment via email: community@thebeanfamily.org.
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
Built Distribution
File details
Details for the file vietqr-generator-0.0.5.tar.gz
.
File metadata
- Download URL: vietqr-generator-0.0.5.tar.gz
- Upload date:
- Size: 19.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
76bba57dfbd5461cb5a09b2b077b1be839f0923dcb9cbb0ce0ecf257b4aa5e48
|
|
MD5 |
c4907f19a8e2c6d6ca22a75c2e9352e9
|
|
BLAKE2b-256 |
670317b32d8d8c96f4355def5c207c3a7819e753a5ad8f8f2d1085ae0b36e876
|
File details
Details for the file vietqr_generator-0.0.5-py3-none-any.whl
.
File metadata
- Download URL: vietqr_generator-0.0.5-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 |
0970423218b9e414c880e5f14f7e53038f42205d27b2b76af628cd76c92d7d3d
|
|
MD5 |
206a022562baa3554c7f1bb68d878392
|
|
BLAKE2b-256 |
401af8c60266c4d2487f8c3c9b5c55b106032931d91b5e8b903fe43a3b69f00d
|