Skip to content

Latest commit

ย 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ’ณ Payment Gateway System

A Java console-based Payment Gateway System developed to demonstrate the practical implementation of core Object-Oriented Programming (OOP) concepts.

The application simulates a simple payment processing workflow where users can select a payment method, enter a payment amount, process the transaction, and receive a formatted payment receipt containing transaction details and the current date and time.


๐Ÿ“Œ Project Description

The Payment Gateway System is a simple Java-based console application created to demonstrate how Object-Oriented Programming concepts can be applied to a real-world scenario.

The system allows users to:

  • Select a payment method
  • Enter the payment amount
  • Process the payment
  • Generate a formatted payment receipt
  • View the transaction date and time

The project currently supports UPI and Credit Card payments and is designed in a way that makes it easy to add new payment methods in the future.

โš ๏ธ Note: This is an educational simulation and does not process real financial transactions.


๐Ÿš€ Features

  • ๐Ÿ’ฐ Accepts payment amount from the user

  • ๐Ÿ’ณ Supports multiple payment methods

    • UPI Payment
    • Credit Card Payment
  • โš™๏ธ Processes the selected payment method

  • ๐Ÿงพ Automatically generates a formatted payment receipt

  • ๐Ÿ“… Displays the current date and time

  • ๐Ÿ”„ Easy to extend with additional payment methods

  • ๐Ÿ–ฅ๏ธ Simple console-based user interface

  • ๐Ÿงฉ Demonstrates real-world usage of Java OOP concepts


๐Ÿง  OOP Concepts Used

This project demonstrates several important Object-Oriented Programming concepts.

1. Interface

A Payment interface defines a common structure for all payment methods.

interface Payment {
    void processPayment(double amount);
}

Different payment classes implement this interface according to their requirements.


2. Abstraction

The payment-processing functionality is abstracted through the Payment interface.

The user does not need to know the internal implementation of each payment method. They simply select a payment method and provide the amount.


3. Polymorphism

Polymorphism allows different payment implementations to be handled using the same interface reference.

Payment payment;

payment = new UPI();
payment.processPayment(amount);

payment = new CreditCard();
payment.processPayment(amount);

The same Payment reference can represent different payment implementations.


4. Method Overriding

Each payment class provides its own implementation of the processPayment() method.

class UPI implements Payment {

    @Override
    public void processPayment(double amount) {
        System.out.println("Processing UPI payment...");
    }
}

The CreditCard class can similarly override the method to provide its own implementation.


๐Ÿ› ๏ธ Technologies Used

Technology Purpose
โ˜• Java Main programming language
๐Ÿงฉ Object-Oriented Programming Application design
๐Ÿ“ฆ java.util Utility classes
โŒจ๏ธ Scanner User input
๐Ÿ“… Date Current date and time

๐Ÿ“‚ Project Structure

Payment-Gateway-System/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ Payment.java
โ”‚   โ”œโ”€โ”€ UPI.java
โ”‚   โ”œโ”€โ”€ CreditCard.java
โ”‚   โ””โ”€โ”€ Main.java
โ”‚
โ”œโ”€โ”€ README.md
โ””โ”€โ”€ .gitignore

File Description

File Description
Payment.java Defines the common payment interface
UPI.java Implements UPI payment functionality
CreditCard.java Implements Credit Card payment functionality
Main.java Handles user input and program execution
README.md Project documentation

๐Ÿ”„ Application Workflow

                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚      START      โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚ Select Payment      โ”‚
                  โ”‚ Method              โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚                 โ”‚
                    โ–ผ                 โ–ผ
              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
              โ”‚    UPI    โ”‚    โ”‚ Credit Card  โ”‚
              โ””โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”˜    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                    โ”‚                 โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚ Enter Payment       โ”‚
                  โ”‚ Amount              โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚ Process Payment     โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                  โ”‚ Generate Receipt    โ”‚
                  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                             โ”‚
                             โ–ผ
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚       END       โ”‚
                    โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

โ–ถ๏ธ How to Run

Prerequisites

Make sure Java JDK is installed on your computer.

Check your Java installation:

java -version

Check the Java compiler:

javac -version

1. Clone the Repository

git clone https://github.com/your-username/payment-gateway-system.git

2. Navigate to the Project

cd payment-gateway-system

3. Compile the Program

If all .java files are in the same directory:

javac *.java

4. Run the Application

java Main

๐Ÿ–ฅ๏ธ Sample Output

========================================
        PAYMENT GATEWAY SYSTEM
========================================

1. UPI Payment
2. Credit Card Payment

Enter your choice: 1

Enter payment amount: 2500

----------------------------------------
           PAYMENT RECEIPT
----------------------------------------
Payment Method : UPI
Amount         : โ‚น2500.00
Status         : Payment Successful
Date & Time    : Sun Aug 09 22:15:30 IST 2026
----------------------------------------

Thank you for using our Payment Gateway!

๐Ÿ”ฎ Future Enhancements

The project can be further enhanced by adding:

  • ๐Ÿฆ Net Banking
  • ๐Ÿ’ณ Debit Card Payment
  • ๐Ÿ“ฑ Digital Wallets
  • ๐Ÿ” OTP Verification
  • ๐Ÿ”‘ PIN Verification
  • ๐Ÿ†” Unique Transaction ID
  • ๐Ÿ“Š Transaction History
  • ๐Ÿ’พ Database Integration
  • ๐Ÿงพ Receipt File Generation
  • โš ๏ธ Input Validation
  • ๐Ÿ›ก๏ธ Exception Handling
  • ๐ŸŒ Web-Based Interface
  • ๐Ÿ–ฅ๏ธ JavaFX/Swing GUI

๐ŸŽฏ Learning Objectives

The main objective of this project is to understand and implement:

  • Classes and Objects
  • Interfaces
  • Abstraction
  • Polymorphism
  • Method Overriding
  • Encapsulation
  • User Input using Scanner
  • Date and Time Handling
  • Basic Java Application Structure
  • Extensible Object-Oriented Design

๐Ÿ—๏ธ OOP Architecture

                         โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                         โ”‚      Payment       โ”‚
                         โ”‚     Interface      โ”‚
                         โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                   โ”‚
                    โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                    โ”‚                             โ”‚
                    โ–ผ                             โ–ผ
             โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”              โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
             โ”‚     UPI      โ”‚              โ”‚ CreditCard   โ”‚
             โ”‚   Payment    โ”‚              โ”‚   Payment    โ”‚
             โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜              โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

The Payment interface provides a common contract for all payment methods.

Each payment implementation overrides the payment-processing method according to its own behavior.


๐Ÿ” Security Disclaimer

This application is created strictly for educational purposes.

It does not connect to:

  • Banks
  • UPI networks
  • Credit card networks
  • Payment gateways
  • Real financial services

No real money or financial transactions are processed by this application.


๐Ÿ“š What I Learned

Through this project, I learned how to apply Java OOP concepts to a practical problem.

The project helped me understand how interfaces and polymorphism can make an application easier to maintain and extend. It also provided practical experience with user input, method overriding, and generating formatted transaction information.


๐Ÿ‘ฉโ€๐Ÿ’ป Author

Sanchi Agarwal

Java | Object-Oriented Programming | Software Development


โญ Show Your Support

If you found this project useful or interesting, consider giving the repository a โญ on GitHub!


๐Ÿ“„ License

This project is created for educational and learning purposes.

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages