Ejemplo n.º 1
0
        /// <summary>
        /// Genera código QR Genera un código QR solicitado por un punto de venta para un pago mediante CODI®
        /// </summary>
        /// <exception cref="MX.Wire4.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body">Información del pago CODI®</param>
        /// <param name="authorization">Header para token</param>
        /// <param name="salesPointId">Identificador del punto de venta</param>
        /// <returns>Task of CodiCodeQrResponseDTO</returns>
        public async System.Threading.Tasks.Task <CodiCodeQrResponseDTO> GenerateCodiCodeQRAsync(CodiCodeRequestDTO body, string authorization, string salesPointId)
        {
            ApiResponse <CodiCodeQrResponseDTO> localVarResponse = await GenerateCodiCodeQRAsyncWithHttpInfo(body, authorization, salesPointId);

            return(localVarResponse.Data);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Genera código QR Genera un código QR solicitado por un punto de venta para un pago mediante CODI®
        /// </summary>
        /// <exception cref="MX.Wire4.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body">Información del pago CODI®</param>
        /// <param name="authorization">Header para token</param>
        /// <param name="salesPointId">Identificador del punto de venta</param>
        /// <returns>Task of ApiResponse (CodiCodeQrResponseDTO)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <CodiCodeQrResponseDTO> > GenerateCodiCodeQRAsyncWithHttpInfo(CodiCodeRequestDTO body, string authorization, string salesPointId)
        {
            // verify the required parameter 'body' is set
            if (body == null)
            {
                throw new ApiException(400, "Missing required parameter 'body' when calling PeticionesDePagoPorCoDiApi->GenerateCodiCodeQR");
            }
            // verify the required parameter 'authorization' is set
            if (authorization == null)
            {
                throw new ApiException(400, "Missing required parameter 'authorization' when calling PeticionesDePagoPorCoDiApi->GenerateCodiCodeQR");
            }
            // verify the required parameter 'salesPointId' is set
            if (salesPointId == null)
            {
                throw new ApiException(400, "Missing required parameter 'salesPointId' when calling PeticionesDePagoPorCoDiApi->GenerateCodiCodeQR");
            }

            var    localVarPath         = "/codi/sales-point/charges";
            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"
            };
            String localVarHttpContentType = this.Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

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

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

            if (salesPointId != null)
            {
                localVarQueryParams.AddRange(this.Configuration.ApiClient.ParameterToKeyValuePairs("", "salesPointId", salesPointId));                       // query parameter
            }
            if (authorization != null)
            {
                localVarHeaderParams.Add("Authorization", this.Configuration.ApiClient.ParameterToString(authorization));                        // header parameter
            }
            if (body != null && body.GetType() != typeof(byte[]))
            {
                localVarPostBody = this.Configuration.ApiClient.Serialize(body); // http body (model) parameter
            }
            else
            {
                localVarPostBody = body; // byte array
            }

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

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <CodiCodeQrResponseDTO>(localVarStatusCode,
                                                           localVarResponse.Headers.ToDictionary(x => x.Name, x => string.Join(",", x.Value)),
                                                           (CodiCodeQrResponseDTO)this.Configuration.ApiClient.Deserialize(localVarResponse, typeof(CodiCodeQrResponseDTO))));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Genera código QR Genera un código QR solicitado por un punto de venta para un pago mediante CODI®
        /// </summary>
        /// <exception cref="MX.Wire4.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="body">Información del pago CODI®</param>
        /// <param name="authorization">Header para token</param>
        /// <param name="salesPointId">Identificador del punto de venta</param>
        /// <returns>CodiCodeQrResponseDTO</returns>
        public CodiCodeQrResponseDTO GenerateCodiCodeQR(CodiCodeRequestDTO body, string authorization, string salesPointId)
        {
            ApiResponse <CodiCodeQrResponseDTO> localVarResponse = GenerateCodiCodeQRWithHttpInfo(body, authorization, salesPointId);

            return(localVarResponse.Data);
        }