public class App {

    public static void main(String[] args) throws Exception {

        Payment creditCard = new CreditCardPayment("1234-5678-9012-3456", "Max Mustermann");

        Payment paypal = new PayPalPayment("max@example.com");

        Payment bankTransfer = new BankTransferPayment("DE89 3704 0044 0532 0130 00");

        processPayment(creditCard, 49.99);

        processPayment(paypal, 19.99);

        processPayment(bankTransfer, 99.99);

    }

    public static void processPayment(Payment payment, double amount) {
        payment.pay(amount);

    }

}