Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -3,13 +3,13 @@ import qrcode
|
|
3 |
from PIL import Image
|
4 |
import time
|
5 |
|
6 |
-
def generate_upi_qr_sticker(
|
7 |
if not merchant_name:
|
8 |
merchant_name = upi_code.split('@')[0]
|
9 |
|
10 |
# Generate UPI QR code
|
11 |
qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
12 |
-
qr_data = f"upi://pay?pa={
|
13 |
|
14 |
qr.add_data(qr_data)
|
15 |
qr.make(fit=True)
|
@@ -31,8 +31,8 @@ iface = gr.Interface(
|
|
31 |
fn=generate_upi_qr_sticker,
|
32 |
inputs=["text", "text", "text"],
|
33 |
outputs="image",
|
34 |
-
title="
|
35 |
-
description="Generate a UPI QR code sticker image."
|
36 |
)
|
37 |
|
38 |
if __name__ == "__main__":
|
|
|
3 |
from PIL import Image
|
4 |
import time
|
5 |
|
6 |
+
def generate_upi_qr_sticker(VPA, amount, VPN=None):
|
7 |
if not merchant_name:
|
8 |
merchant_name = upi_code.split('@')[0]
|
9 |
|
10 |
# Generate UPI QR code
|
11 |
qr = qrcode.QRCode(version=1, box_size=10, border=5)
|
12 |
+
qr_data = f"upi://pay?pa={VPA}&pn={VPN}&am={amount}&cu=INR"
|
13 |
|
14 |
qr.add_data(qr_data)
|
15 |
qr.make(fit=True)
|
|
|
31 |
fn=generate_upi_qr_sticker,
|
32 |
inputs=["text", "text", "text"],
|
33 |
outputs="image",
|
34 |
+
title="Dynamic UPI Payment QR Code",
|
35 |
+
description="Generate a Dynamic UPI QR code sticker image for payments of fix amount."
|
36 |
)
|
37 |
|
38 |
if __name__ == "__main__":
|