public void Handle(PaymentOrder order) { foreach (var handler in handlers) { handler.Handle(order); } }
static void Main(string[] args) { // THis order will be the model from the frontend containing all necessary information PaymentOrder order = new PaymentOrder(); order.PaymentProvider = PaymentProvider.FidelityBank; var handler = new PaymentHandler( new GCBPaymentHandler(), new FidelityBankPaymentHandler(), new StandbicBankPaymentHandler() ); handler.Handle(order); }