コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        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);
        }