QRIS Payment Python Package
Package Python untuk generate QRIS dan cek status pembayaran dengan fitur monitoring realtime.
🚀 Fitur Terbaru (v1.2.0)
- ✅ Generate QRIS dengan nominal tertentu
- ✅ Tambah logo di tengah QR
- ✅ Cek status pembayaran realtime
- ✅ Filter waktu 10 menit (lebih fleksibel)
- ✅ Debug mode untuk monitoring detail
- ✅ Validasi format QRIS yang robust
- ✅ Perhitungan checksum CRC16
- ✅ Error handling yang informatif
- ✅ Type hints untuk development yang lebih baik
- 🆕 URL mutasi manual - Tidak lagi hardcoded, bisa disesuaikan
📦 Instalasi
pip install qris-payment==1.2.0
🔑 Cara Mendapatkan Auth Token
Untuk mendapatkan auth_username dan auth_token, hubungi bot Telegram:
@AutoFtBot - Bot resmi untuk mendapatkan kredensial QRIS Payment
Langkah-langkah:
- Buka Telegram dan cari @AutoFtBot
- Kirim pesan
/start - Ikuti instruksi untuk mendapatkan kredensial
- Bot akan memberikan
auth_usernamedanauth_token
🔄 Migrasi dari v1.1.x ke v1.2.0
BREAKING CHANGE: Versi 1.2.0 memerlukan konfigurasi mutasi_url manual.
Sebelum (v1.1.x):
config = {
'auth_username': 'YOUR_AUTH_USERNAME',
'auth_token': 'YOUR_AUTH_TOKEN',
'base_qr_string': 'YOUR_BASE_QR_STRING'
}
Sekarang (v1.2.0):
config = {
'auth_username': 'YOUR_AUTH_USERNAME',
'auth_token': 'YOUR_AUTH_TOKEN',
'mutasi_url': 'YOUR_MUTASI_API_URL', # WAJIB ditambahkan
'base_qr_string': 'YOUR_BASE_QR_STRING'
}
Catatan: Hubungi @AutoFtBot untuk mendapatkan URL mutasi yang sesuai dengan akun Anda.
🛠️ Penggunaan
Inisialisasi
from qris_payment import QRISPayment
config = {
'auth_username': 'YOUR_AUTH_USERNAME', # Dapat dari @AutoFtBot
'auth_token': 'YOUR_AUTH_TOKEN', # Dapat dari @AutoFtBot
'mutasi_url': 'YOUR_MUTASI_API_URL', # URL API mutasi (manual setting)
'base_qr_string': 'YOUR_BASE_QR_STRING',
'logo_path': 'path/to/logo.png' # Opsional
}
qris = QRISPayment(config)
Generate QRIS
def generate_qr():
try:
result = qris.generate_qr(10000)
# Simpan QR ke file
result['qr_image'].save('qr.png')
print('QR String:', result['qr_string'])
except Exception as e:
print(f"Error: {str(e)}")
Cek Status Pembayaran
def check_payment():
try:
# Reference tidak dipakai untuk pengecekan, hanya amount
result = qris.check_payment('REF123', 10000)
print('Status pembayaran:', result)
except Exception as e:
print(f"Error: {str(e)}")
Debug Mode
# Untuk monitoring detail proses pengecekan
from qris_payment.payment_checker import PaymentChecker
checker = PaymentChecker({
'auth_username': 'YOUR_AUTH_USERNAME',
'auth_token': 'YOUR_AUTH_TOKEN',
'mutasi_url': 'YOUR_MUTASI_API_URL'
}, debug=True)
result = checker.check_payment_status(None, 10000)
📋 Konfigurasi
| Parameter | Tipe | Deskripsi | Wajib |
|---|---|---|---|
| auth_username | string | Username dari @AutoFtBot | Ya |
| auth_token | string | Token dari @AutoFtBot | Ya |
| mutasi_url | string | URL API mutasi (manual setting) | Ya |
| base_qr_string | string | String dasar QRIS | Ya |
| logo_path | string | Path ke file logo (opsional) | Tidak |
📊 Response
Generate QR
{
'qr_string': "000201010212...", # String QRIS dengan checksum
'qr_image': <PIL.Image.Image> # Objek gambar QR
}
Cek Pembayaran
{
'success': True,
'data': {
'status': 'PAID' | 'UNPAID',
'amount': int,
'date': str, # Hanya jika status PAID
'brand_name': str, # Hanya jika status PAID
'buyer_reff': str # Hanya jika status PAID
}
}
⚡ Contoh Realtime Payment
import time
import random
from qris_payment import QRISPayment
config = {
'auth_username': 'YOUR_AUTH_USERNAME',
'auth_token': 'YOUR_AUTH_TOKEN',
'mutasi_url': 'YOUR_MUTASI_API_URL',
'base_qr_string': 'YOUR_BASE_QR_STRING',
'logo_path': './logo.png'
}
def realtime_payment_test():
qris = QRISPayment(config)
# Generate QR dengan nominal random
amount = 100 + random.randint(1, 99)
result = qris.generate_qr(amount)
result['qr_image'].save('qr.png')
print(f'Amount: {amount}')
print('QR saved as: qr.png')
print('Silakan scan dan transfer tepat Rp', amount)
# Monitor pembayaran (10 menit terakhir)
start_time = time.time()
while time.time() - start_time < 300: # 5 menit timeout
payment_result = qris.check_payment('REF', amount)
if payment_result['success'] and payment_result['data']['status'] == 'PAID':
print('🎉 Pembayaran berhasil!')
print('Detail:', payment_result['data'])
return
time.sleep(3)
print('Menunggu pembayaran...')
print('Timeout: Pembayaran tidak diterima')
if __name__ == '__main__':
realtime_payment_test()
🔍 Error Handling
Package ini akan melempar exception dengan pesan yang jelas:
- Format QRIS tidak valid - Pastikan base_qr_string mengandung "5802ID"
- Nominal harus > 0 - Amount harus positif
- Auth credentials tidak valid - Cek username dan token dari @AutoFtBot
- URL mutasi tidak valid - Pastikan mutasi_url sudah diisi dengan benar
- API tidak dapat diakses - Cek koneksi internet dan URL mutasi
- Response tidak valid - Ada masalah dengan server API
📝 Changelog
v1.2.0 (Latest)
- 🆕 URL mutasi manual - Tidak lagi hardcoded, sekarang bisa disesuaikan
- ✅ Konfigurasi
mutasi_urlwajib diisi manual - ✅ Lebih fleksibel untuk berbagai provider API
- ✅ Breaking change: Perlu tambah
mutasi_urldi config
v1.1.5
- ✅ Filter waktu diperpanjang dari 5 menit ke 10 menit
- ✅ Debug mode untuk monitoring detail
- ✅ Error handling yang lebih robust
- ✅ Type hints untuk development
- ✅ Dokumentasi yang lebih lengkap
v1.1.2
- Perbaikan bug minor
- Optimasi performa
v1.1.1
- Fitur QRIS generation
- Payment checking
🖥️ Persyaratan Sistem
- Python >= 3.6
- Dependencies:
- qrcode >= 7.4.2
- Pillow >= 9.0.0
- requests >= 2.28.0
📞 Support
- Bot Telegram: @AutoFtBot (untuk kredensial)
- Repository: GitHub
- Email: autoftbot@gmail.com
📄 Lisensi
MIT License
🤝 Kontribusi
Silakan buat pull request untuk kontribusi. Untuk perubahan besar, buka issue terlebih dahulu untuk mendiskusikan perubahan yang diinginkan.
Dibuat dengan ❤️ oleh AutoFtBot Team
Metadata
Release files for qris-payment 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qris_payment-1.2.0.tar.gz | 9.0 kB | Without provenance | Details for qris_payment-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qris_payment-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for qris_payment-1.2.0-py3-none-any.whl |
Total release size: 16.7 kB
Release files / qris_payment-1.2.0.tar.gz
| Download URL | qris_payment-1.2.0.tar.gz |
|---|---|
| Size | 9.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
fdb447b1db494a0a3ae8291fbb4198f40b5638980292c66b627c2756422e58f4
|
|
BLAKE2b-256 checksum How to use checksums |
9db63f99fcb8d78f0332fe0c434d85c133534f1cad435c9603762c7cccc35604
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / qris_payment-1.2.0-py3-none-any.whl
| Download URL | qris_payment-1.2.0-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1a5cdc1f26536760d0ab280060df32afd56bab8c6fa36fd5d9fad2b0b4aaaff1
|
|
BLAKE2b-256 checksum How to use checksums |
206d63cda5975f3878177e1a2bfac3f769ecb40ad7dff2dcb7992c6dc52072ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for qris-payment 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.