bonrix commited on
Commit
bd94e1f
1 Parent(s): a89fb87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -3,13 +3,13 @@ import qrcode
3
  from PIL import Image
4
  import time
5
 
6
- def generate_upi_qr_sticker(upi_code, amount, merchant_name=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={upi_code}&pn={merchant_name}&am={amount}&cu=INR"
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="Generate UPI QR Code Sticker",
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__":