Welcome to the UPI QR Generator! This slick React web application provides a user-friendly interface to input credit card details and a mobile number, validates the information, and then cleverly generates a UPI QR code or a direct UPI payment link. It's designed to initiate payments via UPI, leveraging specific bank patterns, rather than processing the credit card payment directly.
🎯 Goal: To simplify the process of making payments from credit cards via UPI by generating the necessary UPI ID and payment link based on user input.
- 🚀 Live Access: UPI Credit Card Bill Payment Tool
- Enter Mobile: User inputs their 10-digit mobile number into the segmented fields. 📱
- Enter Card: User inputs their 16-digit credit card number into the segmented fields. 💳
- Validate Card: As the card number is entered (specifically after 6+ digits), the
validateCard
utility function (likely calling an external BIN lookup API) is triggered. - Display Info & Auto-Select: If validation is successful:
- Card scheme (Visa, Mastercard, etc.), type (Credit/Debit), and detected issuer are shown.
- It checks if the card is a Credit card issued in India.
- If valid and the detected issuer matches a bank in the
BANKS
list (findBankByIssuer
), that bank is auto-selected. ✅ - If the card is invalid (not credit, not Indian), an error message is shown. ❌
- Manual Selection (if needed):
- If the card is valid but the issuer wasn't auto-matched, or if the user clicks "Not your issuer?", a list of supported banks (
BANKS
) is shown for manual selection. 🏦
- If the card is valid but the issuer wasn't auto-matched, or if the user clicks "Not your issuer?", a list of supported banks (
- Enter Amount (Optional): User can specify the payment amount. 💰
- Generate UPI Details: Once the mobile number, a valid credit card number, and a selected bank are present:
- The
generateUpiId
function creates the bank-specific UPI ID. - A
upi://pay?...
URL is constructed including the UPI ID, payee name (bank name), amount (if entered), and currency (INR). 🔗
- The
- Display QR / Button:
- Desktop/All: A QR code containing the
upi://
URL is displayed for scanning. 🧾 - Mobile: A "Pay via UPI App" button is also shown. Clicking this button attempts to open the
upi://
URL, which mobile operating systems typically handle by showing a chooser for installed UPI apps (like GPay, PhonePe, Paytm, etc.). 🚀
- Desktop/All: A QR code containing the
-
Clone the repository:
git clone https://github.com/SupratimRK/Credit-Card-Bill-Payments.git cd Credit-Card-Bill-Payments
-
Install dependencies:
npm install
-
Configure Utilities:
- Ensure the
../utils
directory and its files (index.ts
, potentially others) are correctly set up. - Pay special attention to the
BANKS
constant (add/modify supported banks and their logos/UPI generation logic). - Verify the implementation of
validateCard
. If it requires an API key for an external BIN lookup service, make sure it's configured (e.g., via environment variables). - Check the logic within
generateUpiId
to ensure it matches the patterns required by the listed banks.
- Ensure the
-
Run the development server:
npm start
-
Open your browser: Navigate to
http://localhost:5173
(or the port specified). 🎉
PaymentForm.tsx
: The main React component holding the state, logic, and JSX for the entire form interface.utils.ts
:BANKS
: An array/object defining the supported banks, their IDs, names, logos, and potentially UPI ID patterns.validateForm
: Function to perform basic validation on form fields (mobile, amount).generateUpiId
: Core function to create the specific UPI ID based on mobile number and bank rules.validateCard
: Async function to validate the card number, likely checking Luhn algorithm and fetching BIN details (issuer, type, scheme, country) from an external source.findBankByIssuer
: Helper to match the detected card issuer string to a bank in theBANKS
list.getCardSchemeIcon
: Helper to return the path/URL for the card scheme logo (Visa, Mastercard, etc.).
App.tsx
: Contains TypeScript interfaces (FormData
,ValidationErrors
,CardValidationResponse
, etc.) for type safety.
-
🚨 NOT A PAYMENT PROCESSOR: This application DOES NOT process credit card payments directly. It DOES NOT store sensitive card details server-side (and shouldn't!). Its sole purpose is to generate a UPI payment link/QR code based on the inputs. The actual payment happens entirely outside this app, within the user's chosen UPI app.
-
🔐 Security: While the app doesn't store data, entering card details into any web form carries inherent risks. This tool should be used with caution and ideally only on trusted networks/devices. The
validateCard
function relies on an external service; ensure its privacy policy is acceptable. -
🏦 UPI ID Logic: The accuracy of the generated UPI ID depends entirely on the correctness of the logic within
generateUpiId
and the patterns defined for each bank in theBANKS
constant. These patterns can change and might not work for all users or card types from a specific bank. -
🌐 Card Validation Service: The reliability and accuracy of the card issuer auto-detection depend on the external service used by
validateCard
. These services might have rate limits, costs, or occasional downtime. -
💸 Transaction Responsibility: The user is solely responsible for verifying the details (UPI ID, amount, payee name) in their UPI app before confirming the payment. This tool merely facilitates the initiation.
Crafted with 💜 by Supratim
- 🚀 Live Access: UPI Credit Card Bill Payment Tool
- 🙌 Credit: Forked and adapted from RedeemApp/cc-billpay-upi-id
- 🤝 Contributors are most welcome! Feel free to fork, improve, and raise a PR. Whether it's bug fixes, features, or just some code cleanup — all contributions are appreciated!