// public ProductPaymentType PaymentType { get; set; } //Initialize //D public PhyscialMaster InitializePhyscial(Product prod) { PhyscialMaster physcialMaster = null; if (prod.ProductType == ProductPaymentType.Physical) { PhyscialProduct physcialProduct = new PhyscialProduct(); physcialMaster = physcialProduct; } else if (prod.ProductType == ProductPaymentType.Book) { BookProduct bookProduct = new BookProduct(); physcialMaster = bookProduct; } return(physcialMaster); }
//public bool DoPayments(Product prod) //{ // bool isSuccess = false; // //Do Payment // isSuccess = true; // return isSuccess; //} public bool DoActionsPhyscial(Product prod, PhyscialMaster physcialMaster) { bool isSuccess = false; //DoActions if (prod.ProductType == ProductPaymentType.Physical) { PhyscialProduct physcialProduct = new PhyscialProduct(); PackageSlipDetails packageSlipDetails = physcialMaster.GeneratePackageSlip(prod); CommissionPayment commissionPayment = physcialMaster.GenerateCommisionPayment(prod); } else if (prod.ProductType == ProductPaymentType.Book) { BookProduct bookProduct = new BookProduct(); PackageSlipDetails packageSlipDetails = bookProduct.GeneratePackageSlip(prod); CommissionPayment commissionPayment = bookProduct.GenerateCommisionPayment(prod); } isSuccess = true; return(isSuccess); }