private async Task <string> SendPaymentProcessRequest(PaymentModel paymentModel, string paymentStatus) { //Check For Cheap Payment Service if (paymentModel.Amount <= 20) { paymentStatus = _iCheapPaymentGeteway.CreatePayment(paymentModel); } //Check For Expensive Payment Service else if (paymentModel.Amount > 20 & paymentModel.Amount <= 500) { if (paymentGateways.Contains(PaymentGateways.Expensive.ToString())) { paymentStatus = _iExpensivePaymentGateway.CreatePayment(paymentModel); } else { paymentStatus = _iCheapPaymentGeteway.CreatePayment(paymentModel); } } //Check For Premium Payment Service else if (paymentModel.Amount > 500) { paymentStatus = _iPremiumPaymentGeteway.CreatePayment(paymentModel); if (paymentStatus == PaymentStatus.Failed.ToString() && paymentProcessRetry < 3) { paymentProcessRetry++; await SendPaymentProcessRequest(paymentModel, paymentStatus); } } return(paymentStatus); }