/// <summary>
        /// completePartiallyOnline This operation can be used to partially complete the transaction online. The completion is forwarded to the processor. This implies that the processor may take some actions based on the completion.
        /// </summary>
        /// <exception cref="TrustPayments.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="spaceId"></param>
        /// <param name="completion"></param>
        /// <returns>ApiResponse of TransactionCompletion</returns>
        public ApiResponse <TransactionCompletion> CompletePartiallyOnlineWithHttpInfo(long?spaceId, TransactionCompletionRequest completion)
        {
            // verify the required parameter 'spaceId' is set
            if (spaceId == null)
            {
                throw new ApiException(400, "Missing required parameter 'spaceId' when calling TransactionCompletionService->CompletePartiallyOnline");
            }
            // verify the required parameter 'completion' is set
            if (completion == null)
            {
                throw new ApiException(400, "Missing required parameter 'completion' when calling TransactionCompletionService->CompletePartiallyOnline");
            }

            var    localVarPath         = "/transaction-completion/completePartiallyOnline";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new List <KeyValuePair <String, String> >();
            var    localVarHeaderParams = new Dictionary <String, String>(this.Configuration.DefaultHeader);
            var    localVarFormParams   = new Dictionary <String, String>();
            var    localVarFileParams   = new Dictionary <String, FileParameter>();
            Object localVarPostBody     = null;

            // to determine the Content-Type header
            String[] localVarHttpContentTypes = new String[] {
                "application/json;charset=utf-8"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

            // to determine the Accept header
            String[] localVarHttpHeaderAccepts = new String[] {
                "application/json;charset=utf-8"
            };
            String localVarHttpHeaderAccept = this.Configuration.ApiClient.SelectHeaderAccept(localVarHttpHeaderAccepts);

            if (localVarHttpHeaderAccept != null)
            {
                localVarHeaderParams.Add("Accept", localVarHttpHeaderAccept);
            }

            if (spaceId != null)
            {
                localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "spaceId", spaceId));                  // query parameter
            }
            if (completion != null && completion.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(completion); // http body (model) parameter
            }
            else
            {
                localVarPostBody = completion; // byte array
            }


            this.Configuration.ApiClient.ResetTimeout();
            // make the HTTP request
            IRestResponse localVarResponse = (IRestResponse)this.Configuration.ApiClient.CallApi(localVarPath,
                                                                                                 Method.POST, localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarFileParams,
                                                                                                 localVarPathParams, localVarHttpContentType);

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("CompletePartiallyOnline", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <TransactionCompletion>(localVarStatusCode,
                                                           localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                           (TransactionCompletion)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(TransactionCompletion))));
        }
        /// <summary>
        /// completePartiallyOnline This operation can be used to partially complete the transaction online. The completion is forwarded to the processor. This implies that the processor may take some actions based on the completion.
        /// </summary>
        /// <exception cref="TrustPayments.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="spaceId"></param>
        /// <param name="completion"></param>
        /// <returns>TransactionCompletion</returns>
        public TransactionCompletion CompletePartiallyOnline(long?spaceId, TransactionCompletionRequest completion)
        {
            ApiResponse <TransactionCompletion> localVarResponse = CompletePartiallyOnlineWithHttpInfo(spaceId, completion);

            return(localVarResponse.Data);
        }