public async Task <ActionResult> FlutterwavePay(string refcode) { string queryRef = refcode; ProcessFlutterWavePayment flwpayment = new ProcessFlutterWavePayment(); flwpayment.RefCode = queryRef; var bookingResult = await Logical.PostFlutterWavePayment(flwpayment); var error = bookingResult.Item2; Session["queryRef"] = flwpayment.RefCode; if (error != null) { Session["transactionDetails"] = bookingResult.Item1; Session["Errormsg"] = "Transaction Failed"; return(RedirectToAction("PaymentError")); } if (bookingResult.Item1.Object != null) { Session["transactionDetails"] = bookingResult.Item1; //var refCode = if (bookingResult.Item1.Object.Response.ToLower() == "approved") { return(RedirectToAction("PaymentConfirmation")); } else { Session["Errormsg"] = bookingResult.Item1.Object.Response; return(RedirectToAction("PaymentError")); } } else { Session["Errormsg"] = "Transaction Failed"; return(RedirectToAction("PaymentError")); } }
public static async Task <Tuple <PostSearchResponseModel, ErrorModel> > PostFlutterWavePayment(ProcessFlutterWavePayment flutterwavepaymentopt) { using (HttpClientHelper client = new HttpClientHelper()) { PostSearchResponseModel bookobj = new PostSearchResponseModel(); ErrorModel errorModel = null; await client.ProcessClientRequestAsync <PostSearchResponseModel>(GigUrl.ProcessFlutterWavePayment, HttpMethod.Post, flutterwavepaymentopt, success => { bookobj = success; }, error => { errorModel = error; } ); return(new Tuple <PostSearchResponseModel, ErrorModel>(bookobj, errorModel)); } }