public IPayment CreatePayment(Product pProduct) { IPayment payment = null; switch (pProduct.Category) { case (Int16)enmCategory.Physical: if (pProduct.ProductType == "Books") { payment = new BookPayment(_commission); } else { payment = new ProductPayment(_commission); } break; case (Int16)enmCategory.Membership: if (pProduct.ProductType == "New") { payment = new NewMembershipPayment(_membership, _notification); } else { payment = new UpgradeMembershipPayment(_membership, _notification); } break; case (Int16)enmCategory.Video: payment = new VideoPayment(); break; } return(payment); }
public UpgradeMembershipProcess(UpgradeMembershipPayment upgradeMembershipPayment) { this._upgradeMembershipPayment = upgradeMembershipPayment; }