Skip to content

Abstract class or interface?

You are designing payment handling. Every payment method must implement process(), and card payments and UPI payments share a chunk of validation logic and a transaction-id field.

What fits best?