Initiating an action based on product type
You have a conditional based on the type of object. You can apply the Replace Conditional with Polymorphism refactoring pattern. 

In this case, you might have a base class Product, with subclasses DigitalProduct and PhysicalProduct which each implement discount(). I don't think it's sensible to have a MembershipProduct class - membership should be related to the buyer. From an OO perspective, it should feel wrong when you have methods like discount_for_X() - the method should be part of the respective class so that you can make use of polymorphism.