Skip to content

Instantly share code, notes, and snippets.

@dance2die
Created March 26, 2018 01:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dance2die/aad6b604536afeb10f71771cc42e3853 to your computer and use it in GitHub Desktop.
Save dance2die/aad6b604536afeb10f71771cc42e3853 to your computer and use it in GitHub Desktop.
public static class PaymentStrategyFactory
{
public static IPaymentStrategy Create(string paymentProvider)
{
switch (paymentProvider)
{
case "Paypal": return new PaypalPaymentStrategy();
case "ApplePay": return new ApplePayPaymentStrategy();
default: return NullPaymentStrategy.Instance;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment