Automate This

Automate This: Chapter 12: Abstraction and Payment Systems in Java


Listen Later

Welcome to Automate This! 🎙️


This podcast started as a little life hack for myself—a way to skip re-reading my own blog posts and instead listen to them on the go. Crafted using NotebookLM, it’s a personal productivity experiment that quickly evolved into something worth sharing!


Born from the blog Automate This (medium.com/@automatethis), this podcast turns complex topics into bite-sized, fun, and interactive episodes. Whether it's mastering Java, Selenium, Appium, or GitHub—or diving into automation solutions for payment systems and fintech applications—we make it sound easy (and sometimes even funny).


Tune in while driving, cooking, or juggling spreadsheets. Automate This is here to save you time, sharpen your automation skills, and make your downtime productive. Who knew staying on top of tech could be this effortless?


📌 For the best experience, check out the blog and repo links included in each post.


Grab your headphones, hit play, and let’s automate your world, one clever trick at a time! 🚀


Code Snippet:

===============================================

package abstractionWithConstructorExample;
abstract class abstractPaymentsBaseClass {
// Abstract method to be implemented by child classes
abstract void processPayments(double amount, String registeredName);
// Concrete method for status check
public void checkStatus() {
System.out.println("Transaction Success");
}
}
package abstractionWithConstructorExample;
public class abstract_upiPayments extends abstractPaymentsBaseClass {
@Override
void processPayments(double amount, String registeredName) {
System.out.println("Hello! " + registeredName);
System.out.println("Transaction processing...");
System.out.println("Verifying Secure Transaction...");
System.out.println("Money is sent using UPI payments, amount: " + amount);
}
}
package abstractionWithConstructorExample;
public class abstract_debitCardPayments extends abstractPaymentsBaseClass {
@Override
void processPayments(double amount, String registeredName) {
System.out.println("Hello! " + registeredName);
System.out.println("Transaction processing...");
System.out.println("Verifying Secure Transaction...");
System.out.println("Money is sent using Debit Card payments, amount: " + amount);
}
}
package abstractionWithConstructorExample;
public class abstract_PaymentService {
private abstractPaymentsBaseClass abstractPaymentsBaseClass;
// Constructor to inject the payment type
public abstract_PaymentService(abstractPaymentsBaseClass abstractPaymentsBaseClass) {
this.abstractPaymentsBaseClass = abstractPaymentsBaseClass;
}
// Calls the payment method
public void makePayments(double amount, String registeredName) {
abstractPaymentsBaseClass.processPayments(amount, registeredName);
}
// Calls the status check
public void statusCheck() {
abstractPaymentsBaseClass.checkStatus();
}
}
package abstractionWithConstructorExample;
public class abstract_doPayments {
public static void main(String[] args) {
// Using UPI Payments
abstractPaymentsBaseClass payments = new abstract_upiPayments();
abstract_PaymentService paymentService = new abstract_PaymentService(payments);
paymentService.makePayments(405.50, "Bhanu");
paymentService.statusCheck();
// Using Debit Card Payments
payments = new abstract_debitCardPayments();
paymentService = new abstract_PaymentService(payments);
paymentService.makePayments(5004.80, "Bhanu");
paymentService.statusCheck();
}
}

...more
View all episodesView all episodes
Download on the App Store

Automate ThisBy Mrigank Shubham Saxena