How to make automatic UPI payment

75 Views Asked by At

I need to make small UPI payments to multiple UPI ids at once. Is there any way to make these automatic UPI payments using code? I tried asking ChatGPT and this is the response I got -

import upstipy

# Initialize the UPI client
client = upstipy.UPI()

# Set your UPI ID and PIN (You can also use environment variables or secure methods to store these)
client.set_credentials("your_upi_id@bank", "your_upi_pin")

# Define a list of payments
payments = [
    {"receiver_vpa": "receiver1@bank", "amount": 100, "remarks": "Payment 1"},
    {"receiver_vpa": "receiver2@bank", "amount": 150, "remarks": "Payment 2"},
    # Add more payments as needed
]

# Make bulk payments
for payment in payments:
    try:
        response = client.transfer(payment["receiver_vpa"], payment["amount"], payment["remarks"])
        print("Payment successful:", response)
    except upstipy.UPITransferError as e:
        print("Payment failed:", e)

This satisfies my use case however I cannot find any resources on the upstipy library which makes me highly skeptical to run it. Is there any viable way to do it without relying on third-party services?

0

There are 0 best solutions below