private async Task <ValidationResponse <CustomerToBusinessSimulationResponse> > SimulateValidatedAsync( CustomerToBusinessSimulationRequest customerToBusinessSimulationRequest) { var response = await tokenizedApiCaller.CallEndpoint <CustomerToBusinessSimulationResponse>( "mpesa/c2b/v1/simulate", HttpMethod.Post, customerToBusinessSimulationRequest ); return(validationResponseHelper.SuccessValue(response)); }
public async Task <ValidationResponse <CustomerToBusinessSimulationResponse> > SimulateAsync( CustomerToBusinessSimulationRequest customerToBusinessSimulationRequest ) { using (var validator = new BasicFormValidator <CustomerToBusinessSimulationRequest>()) { var validationResponse = await validator.ValidateAndPackAsync(customerToBusinessSimulationRequest); return(await validationResponseHelper.RouteResponseTypedAsync <CustomerToBusinessSimulationRequest, CustomerToBusinessSimulationResponse>( validationResponse, async (_) => await SimulateValidatedAsync(customerToBusinessSimulationRequest) )); } }