public async Task <RegisterEmploymentCheckResponse> Register(RegisterEmploymentCheckRequest request) { var response = await _client.PostWithResponseCode <RegisterEmploymentCheckResponse>(request); if (ApiResponseErrorChecking.IsSuccessStatusCode(response.StatusCode)) { return(response.Body); } throw new HttpRequestContentException($"Response status code does not indicate success: {(int)response.StatusCode} ({response.StatusCode})", response.StatusCode, response.ErrorContent); }
public async Task <RegisterCheckResponse> Handle(RegisterCheckCommand command, CancellationToken cancellationToken) { var response = await _client.PostWithResponseCode <RegisterCheckResponse>(new RegisterCheckRequest(command)); if (ApiResponseErrorChecking.IsSuccessStatusCode(response.StatusCode)) { return(response.Body); } throw new HttpRequestContentException($"Response status code does not indicate success: {(int)response.StatusCode} ({response.StatusCode})", response.StatusCode, response.ErrorContent); }
public async Task RevertPayments(RevertPaymentsRequest revertPaymentsRequest) { var postRequest = new PostRevertPaymentsRequest(revertPaymentsRequest); var response = await _client.PostWithResponseCode <PostRevertPaymentsRequest>(postRequest); if (ApiResponseErrorChecking.IsSuccessStatusCode(response.StatusCode)) { return; } throw new HttpRequestContentException($"Response status code does not indicate success: {(int)response.StatusCode} ({response.StatusCode})", response.StatusCode, response.ErrorContent); }