static async Task <string> ListPayments() { Console.WriteLine(); Console.WriteLine("******Listing payments test***********"); Console.WriteLine(); Uri u = new Uri(baseUrl + "listpayments"); var response = string.Empty; using (var client = new HttpClient()) { ListPaymentsRequest payload = new ListPaymentsRequest(); HttpResponseMessage res = await client.PostAsJsonAsync(u, payload); if (res.IsSuccessStatusCode) { ListPaymentResponse reply = await res.Content.ReadAsAsync <ListPaymentResponse>(); foreach (var p in newlyAddedPayments) { if (!reply.Payments.Any(x => x.PaymentId == p.Key && x.Status == p.Value)) { Console.WriteLine("Failed to create payment with right status"); } } return(JsonConvert.SerializeObject(reply)); } } return(response); }
public ListPaymentResponse ListPayments(ListPaymentsRequest request) { return(paymentService.ListPayments(request)); }
/// <summary> /// This method is for user story 4 /// </summary> /// <param name="request"></param> /// <returns></returns> public ListPaymentResponse ListPayments(ListPaymentsRequest request) { // request object not used as search criteria not part of the specification return((ListPaymentResponse) new ListPaymentsBL(this.PaymentValidatorService).ExecuteAction(request)); }