Ejemplo n.º 1
0
        public static RiskV1ExportComplianceInquiriesPost201Response Run()
        {
            string clientReferenceInformationCode     = "verification example";
            string clientReferenceInformationComments = "Export-basic";
            Riskv1addressverificationsClientReferenceInformation clientReferenceInformation = new Riskv1addressverificationsClientReferenceInformation(
                Code: clientReferenceInformationCode,
                Comments: clientReferenceInformationComments
                );

            string orderInformationBillToAddress1           = "901 Metro Centre Blvd";
            string orderInformationBillToAdministrativeArea = "CA";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "Foster City";
            string orderInformationBillToPostalCode         = "94404";
            string orderInformationBillToCompanyName        = "A & C International Trade, Inc";
            Riskv1exportcomplianceinquiriesOrderInformationBillToCompany orderInformationBillToCompany = new Riskv1exportcomplianceinquiriesOrderInformationBillToCompany(
                Name: orderInformationBillToCompanyName
                );

            string orderInformationBillToFirstName = "ANDREE";
            string orderInformationBillToLastName  = "AGNESE";
            string orderInformationBillToEmail     = "*****@*****.**";
            Riskv1exportcomplianceinquiriesOrderInformationBillTo orderInformationBillTo = new Riskv1exportcomplianceinquiriesOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode,
                Company: orderInformationBillToCompany,
                FirstName: orderInformationBillToFirstName,
                LastName: orderInformationBillToLastName,
                Email: orderInformationBillToEmail
                );

            string orderInformationShipToCountry   = "IN";
            string orderInformationShipToFirstName = "DumbelDore";
            string orderInformationShipToLastName  = "Albus";
            Riskv1exportcomplianceinquiriesOrderInformationShipTo orderInformationShipTo = new Riskv1exportcomplianceinquiriesOrderInformationShipTo(
                Country: orderInformationShipToCountry,
                FirstName: orderInformationShipToFirstName,
                LastName: orderInformationShipToLastName
                );


            List <Riskv1exportcomplianceinquiriesOrderInformationLineItems> orderInformationLineItems = new List <Riskv1exportcomplianceinquiriesOrderInformationLineItems>();
            string orderInformationLineItemsUnitPrice1   = "120.50";
            int    orderInformationLineItemsQuantity1    = 3;
            string orderInformationLineItemsProductSKU1  = "123456";
            string orderInformationLineItemsProductName1 = "Qwe";
            string orderInformationLineItemsProductCode1 = "physical_software";

            orderInformationLineItems.Add(new Riskv1exportcomplianceinquiriesOrderInformationLineItems(
                                              UnitPrice: orderInformationLineItemsUnitPrice1,
                                              Quantity: orderInformationLineItemsQuantity1,
                                              ProductSKU: orderInformationLineItemsProductSKU1,
                                              ProductName: orderInformationLineItemsProductName1,
                                              ProductCode: orderInformationLineItemsProductCode1
                                              ));

            Riskv1exportcomplianceinquiriesOrderInformation orderInformation = new Riskv1exportcomplianceinquiriesOrderInformation(
                BillTo: orderInformationBillTo,
                ShipTo: orderInformationShipTo,
                LineItems: orderInformationLineItems
                );

            var requestObj = new ValidateExportComplianceRequest(
                ClientReferenceInformation: clientReferenceInformation,
                OrderInformation: orderInformation
                );

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new VerificationApi(clientConfig);
                RiskV1ExportComplianceInquiriesPost201Response result = apiInstance.ValidateExportCompliance(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        public static RiskV1ExportComplianceInquiriesPost201Response Run()
        {
            string clientReferenceInformationCode     = "verification example";
            string clientReferenceInformationComments = "All fields";
            Riskv1addressverificationsClientReferenceInformation clientReferenceInformation = new Riskv1addressverificationsClientReferenceInformation(
                Code: clientReferenceInformationCode,
                Comments: clientReferenceInformationComments
                );

            string orderInformationBillToAddress1           = "901 Metro Centre Blvd";
            string orderInformationBillToAddress2           = " ";
            string orderInformationBillToAddress3           = "";
            string orderInformationBillToAddress4           = "Foster City";
            string orderInformationBillToAdministrativeArea = "NH";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "CA";
            string orderInformationBillToPostalCode         = "03055";
            string orderInformationBillToCompanyName        = "A & C International Trade, Inc.";
            Riskv1exportcomplianceinquiriesOrderInformationBillToCompany orderInformationBillToCompany = new Riskv1exportcomplianceinquiriesOrderInformationBillToCompany(
                Name: orderInformationBillToCompanyName
                );

            string orderInformationBillToFirstName = "Suman";
            string orderInformationBillToLastName  = "Kumar";
            string orderInformationBillToEmail     = "*****@*****.**";
            Riskv1exportcomplianceinquiriesOrderInformationBillTo orderInformationBillTo = new Riskv1exportcomplianceinquiriesOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                Address2: orderInformationBillToAddress2,
                Address3: orderInformationBillToAddress3,
                Address4: orderInformationBillToAddress4,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode,
                Company: orderInformationBillToCompany,
                FirstName: orderInformationBillToFirstName,
                LastName: orderInformationBillToLastName,
                Email: orderInformationBillToEmail
                );

            string orderInformationShipToCountry   = "IN";
            string orderInformationShipToFirstName = "DumbelDore";
            string orderInformationShipToLastName  = "Albus";
            Riskv1exportcomplianceinquiriesOrderInformationShipTo orderInformationShipTo = new Riskv1exportcomplianceinquiriesOrderInformationShipTo(
                Country: orderInformationShipToCountry,
                FirstName: orderInformationShipToFirstName,
                LastName: orderInformationShipToLastName
                );


            List <Riskv1exportcomplianceinquiriesOrderInformationLineItems> orderInformationLineItems = new List <Riskv1exportcomplianceinquiriesOrderInformationLineItems>();
            string orderInformationLineItemsUnitPrice1   = "120.50";
            int    orderInformationLineItemsQuantity1    = 3;
            string orderInformationLineItemsProductSKU1  = "610009";
            string orderInformationLineItemsProductName1 = "Xer";
            string orderInformationLineItemsProductCode1 = "physical_software";

            orderInformationLineItems.Add(new Riskv1exportcomplianceinquiriesOrderInformationLineItems(
                                              UnitPrice: orderInformationLineItemsUnitPrice1,
                                              Quantity: orderInformationLineItemsQuantity1,
                                              ProductSKU: orderInformationLineItemsProductSKU1,
                                              ProductName: orderInformationLineItemsProductName1,
                                              ProductCode: orderInformationLineItemsProductCode1
                                              ));

            Riskv1exportcomplianceinquiriesOrderInformation orderInformation = new Riskv1exportcomplianceinquiriesOrderInformation(
                BillTo: orderInformationBillTo,
                ShipTo: orderInformationShipTo,
                LineItems: orderInformationLineItems
                );

            string buyerInformationMerchantCustomerId = "Export1";
            Riskv1addressverificationsBuyerInformation buyerInformation = new Riskv1addressverificationsBuyerInformation(
                MerchantCustomerId: buyerInformationMerchantCustomerId
                );

            string deviceInformationIpAddress = "127.0.0.1";
            string deviceInformationHostName  = "www.cybersource.ir";
            Riskv1exportcomplianceinquiriesDeviceInformation deviceInformation = new Riskv1exportcomplianceinquiriesDeviceInformation(
                IpAddress: deviceInformationIpAddress,
                HostName: deviceInformationHostName
                );

            string exportComplianceInformationAddressOperator = "and";
            string exportComplianceInformationWeightsAddress  = "low";
            string exportComplianceInformationWeightsCompany  = "exact";
            string exportComplianceInformationWeightsName     = "exact";
            Riskv1exportcomplianceinquiriesExportComplianceInformationWeights exportComplianceInformationWeights = new Riskv1exportcomplianceinquiriesExportComplianceInformationWeights(
                Address: exportComplianceInformationWeightsAddress,
                Company: exportComplianceInformationWeightsCompany,
                Name: exportComplianceInformationWeightsName
                );


            List <string> exportComplianceInformationSanctionLists = new List <string>();

            exportComplianceInformationSanctionLists.Add("Bureau Of Industry and Security");
            exportComplianceInformationSanctionLists.Add("DOS_DTC");
            exportComplianceInformationSanctionLists.Add("AUSTRALIA");
            Riskv1exportcomplianceinquiriesExportComplianceInformation exportComplianceInformation = new Riskv1exportcomplianceinquiriesExportComplianceInformation(
                AddressOperator: exportComplianceInformationAddressOperator,
                Weights: exportComplianceInformationWeights,
                SanctionLists: exportComplianceInformationSanctionLists
                );

            var requestObj = new ValidateExportComplianceRequest(
                ClientReferenceInformation: clientReferenceInformation,
                OrderInformation: orderInformation,
                BuyerInformation: buyerInformation,
                DeviceInformation: deviceInformation,
                ExportComplianceInformation: exportComplianceInformation
                );

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new VerificationApi(clientConfig);
                RiskV1ExportComplianceInquiriesPost201Response result = apiInstance.ValidateExportCompliance(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        /// <summary>
        /// Validate export compliance This call checks customer data against specified watch lists to ensure export compliance.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="validateExportComplianceRequest"></param>
        /// <returns>Task of RiskV1ExportComplianceInquiriesPost201Response</returns>
        public async System.Threading.Tasks.Task <RiskV1ExportComplianceInquiriesPost201Response> ValidateExportComplianceAsync(ValidateExportComplianceRequest validateExportComplianceRequest)
        {
            ApiResponse <RiskV1ExportComplianceInquiriesPost201Response> localVarResponse = await ValidateExportComplianceAsyncWithHttpInfo(validateExportComplianceRequest);

            return(localVarResponse.Data);
        }
        /// <summary>
        /// Validate export compliance This call checks customer data against specified watch lists to ensure export compliance.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="validateExportComplianceRequest"></param>
        /// <returns>Task of ApiResponse (RiskV1ExportComplianceInquiriesPost201Response)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <RiskV1ExportComplianceInquiriesPost201Response> > ValidateExportComplianceAsyncWithHttpInfo(ValidateExportComplianceRequest validateExportComplianceRequest)
        {
            // verify the required parameter 'validateExportComplianceRequest' is set
            if (validateExportComplianceRequest == null)
            {
                throw new ApiException(400, "Missing required parameter 'validateExportComplianceRequest' when calling VerificationApi->ValidateExportCompliance");
            }

            var    localVarPath         = $"/risk/v1/export-compliance-inquiries";
            var    localVarPathParams   = new Dictionary <String, String>();
            var    localVarQueryParams  = new Dictionary <String, String>();
            var    localVarHeaderParams = new Dictionary <String, String>(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

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

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

            if (validateExportComplianceRequest != null && validateExportComplianceRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(validateExportComplianceRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = validateExportComplianceRequest; // byte array
            }


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

            int localVarStatusCode = (int)localVarResponse.StatusCode;

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

            return(new ApiResponse <RiskV1ExportComplianceInquiriesPost201Response>(localVarStatusCode,
                                                                                    localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                                    (RiskV1ExportComplianceInquiriesPost201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1ExportComplianceInquiriesPost201Response))));
        }
        /// <summary>
        /// Validate export compliance This call checks customer data against specified watch lists to ensure export compliance.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="validateExportComplianceRequest"></param>
        /// <returns>RiskV1ExportComplianceInquiriesPost201Response</returns>
        public RiskV1ExportComplianceInquiriesPost201Response ValidateExportCompliance(ValidateExportComplianceRequest validateExportComplianceRequest)
        {
            ApiResponse <RiskV1ExportComplianceInquiriesPost201Response> localVarResponse = ValidateExportComplianceWithHttpInfo(validateExportComplianceRequest);

            return(localVarResponse.Data);
        }
Ejemplo n.º 6
0
        public static RiskV1ExportComplianceInquiriesPost201Response Run()
        {
            string clientReferenceInformationCode = "verification example";
            Riskv1liststypeentriesClientReferenceInformation clientReferenceInformation = new Riskv1liststypeentriesClientReferenceInformation(
                Code: clientReferenceInformationCode
                );

            string orderInformationBillToAddress1           = "901 Metro Centre Blvd";
            string orderInformationBillToAddress2           = "2";
            string orderInformationBillToAdministrativeArea = "CA";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "Foster City";
            string orderInformationBillToPostalCode         = "94404";
            string orderInformationBillToFirstName          = "Suman";
            string orderInformationBillToLastName           = "Kumar";
            string orderInformationBillToEmail = "*****@*****.**";
            Riskv1exportcomplianceinquiriesOrderInformationBillTo orderInformationBillTo = new Riskv1exportcomplianceinquiriesOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                Address2: orderInformationBillToAddress2,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode,
                FirstName: orderInformationBillToFirstName,
                LastName: orderInformationBillToLastName,
                Email: orderInformationBillToEmail
                );

            string orderInformationShipToCountry   = "be";
            string orderInformationShipToFirstName = "DumbelDore";
            string orderInformationShipToLastName  = "Albus";
            Riskv1exportcomplianceinquiriesOrderInformationShipTo orderInformationShipTo = new Riskv1exportcomplianceinquiriesOrderInformationShipTo(
                Country: orderInformationShipToCountry,
                FirstName: orderInformationShipToFirstName,
                LastName: orderInformationShipToLastName
                );


            List <Riskv1exportcomplianceinquiriesOrderInformationLineItems> orderInformationLineItems = new List <Riskv1exportcomplianceinquiriesOrderInformationLineItems>();
            string orderInformationLineItemsUnitPrice1 = "19.00";

            orderInformationLineItems.Add(new Riskv1exportcomplianceinquiriesOrderInformationLineItems(
                                              UnitPrice: orderInformationLineItemsUnitPrice1
                                              ));

            Riskv1exportcomplianceinquiriesOrderInformation orderInformation = new Riskv1exportcomplianceinquiriesOrderInformation(
                BillTo: orderInformationBillTo,
                ShipTo: orderInformationShipTo,
                LineItems: orderInformationLineItems
                );

            string buyerInformationMerchantCustomerId = "87789";
            Riskv1addressverificationsBuyerInformation buyerInformation = new Riskv1addressverificationsBuyerInformation(
                MerchantCustomerId: buyerInformationMerchantCustomerId
                );

            var requestObj = new ValidateExportComplianceRequest(
                ClientReferenceInformation: clientReferenceInformation,
                OrderInformation: orderInformation,
                BuyerInformation: buyerInformation
                );

            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);

                var apiInstance = new VerificationApi(clientConfig);
                RiskV1ExportComplianceInquiriesPost201Response result = apiInstance.ValidateExportCompliance(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        /// <summary>
        /// Validate export compliance This call checks customer data against specified watch lists to ensure export compliance.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="validateExportComplianceRequest"></param>
        /// <returns>Task of RiskV1ExportComplianceInquiriesPost201Response</returns>
        public async System.Threading.Tasks.Task <RiskV1ExportComplianceInquiriesPost201Response> ValidateExportComplianceAsync(ValidateExportComplianceRequest validateExportComplianceRequest)
        {
            logger.Debug("CALLING API \"ValidateExportComplianceAsync\" STARTED");
            this.SetStatusCode(null);
            ApiResponse <RiskV1ExportComplianceInquiriesPost201Response> localVarResponse = await ValidateExportComplianceAsyncWithHttpInfo(validateExportComplianceRequest);

            logger.Debug("CALLING API \"ValidateExportComplianceAsync\" ENDED");
            this.SetStatusCode(localVarResponse.StatusCode);
            return(localVarResponse.Data);
        }
        /// <summary>
        /// Validate export compliance This call checks customer data against specified watch lists to ensure export compliance.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="validateExportComplianceRequest"></param>
        /// <returns>ApiResponse of RiskV1ExportComplianceInquiriesPost201Response</returns>
        public ApiResponse <RiskV1ExportComplianceInquiriesPost201Response> ValidateExportComplianceWithHttpInfo(ValidateExportComplianceRequest validateExportComplianceRequest)
        {
            LogUtility logUtility = new LogUtility();

            // verify the required parameter 'validateExportComplianceRequest' is set
            if (validateExportComplianceRequest == null)
            {
                logger.Error("ApiException : Missing required parameter 'validateExportComplianceRequest' when calling VerificationApi->ValidateExportCompliance");
                throw new ApiException(400, "Missing required parameter 'validateExportComplianceRequest' when calling VerificationApi->ValidateExportCompliance");
            }

            var    localVarPath         = $"/risk/v1/export-compliance-inquiries";
            var    localVarPathParams   = new Dictionary <string, string>();
            var    localVarQueryParams  = new Dictionary <string, string>();
            var    localVarHeaderParams = new Dictionary <string, string>(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 = Configuration.ApiClient.SelectHeaderContentType(localVarHttpContentTypes);

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

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

            if (validateExportComplianceRequest != null && validateExportComplianceRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(validateExportComplianceRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = validateExportComplianceRequest; // byte array
            }

            if (logUtility.IsMaskingEnabled(logger))
            {
                logger.Debug($"HTTP Request Body :\n{logUtility.MaskSensitiveData(localVarPostBody.ToString())}");
            }
            else
            {
                logger.Debug($"HTTP Request Body :\n{localVarPostBody}");
            }


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

            int localVarStatusCode = (int)localVarResponse.StatusCode;

            if (ExceptionFactory != null)
            {
                Exception exception = ExceptionFactory("ValidateExportCompliance", localVarResponse);
                if (exception != null)
                {
                    logger.Error($"Exception : {exception.Message}");
                    throw exception;
                }
            }

            return(new ApiResponse <RiskV1ExportComplianceInquiriesPost201Response>(localVarStatusCode,
                                                                                    localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                                    (RiskV1ExportComplianceInquiriesPost201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1ExportComplianceInquiriesPost201Response)))); // Return statement
        }
        /// <summary>
        /// Validate export compliance This call checks customer data against specified watch lists to ensure export compliance.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="validateExportComplianceRequest"></param>
        /// <returns>RiskV1ExportComplianceInquiriesPost201Response</returns>
        public RiskV1ExportComplianceInquiriesPost201Response ValidateExportCompliance(ValidateExportComplianceRequest validateExportComplianceRequest)
        {
            logger.Debug("CALLING API \"ValidateExportCompliance\" STARTED");
            this.SetStatusCode(null);
            ApiResponse <RiskV1ExportComplianceInquiriesPost201Response> localVarResponse = ValidateExportComplianceWithHttpInfo(validateExportComplianceRequest);

            logger.Debug("CALLING API \"ValidateExportCompliance\" ENDED");
            this.SetStatusCode(localVarResponse.StatusCode);
            return(localVarResponse.Data);
        }