/// <summary>
        /// Verify customer address This call verifies that the customer address submitted is valid.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyCustomerAddressRequest"></param>
        /// <returns>RiskV1AddressVerificationsPost201Response</returns>
        public RiskV1AddressVerificationsPost201Response VerifyCustomerAddress(VerifyCustomerAddressRequest verifyCustomerAddressRequest)
        {
            logger.Debug("CALLING API \"VerifyCustomerAddress\" STARTED");
            this.SetStatusCode(null);
            ApiResponse <RiskV1AddressVerificationsPost201Response> localVarResponse = VerifyCustomerAddressWithHttpInfo(verifyCustomerAddressRequest);

            logger.Debug("CALLING API \"VerifyCustomerAddress\" ENDED");
            this.SetStatusCode(localVarResponse.StatusCode);
            return(localVarResponse.Data);
        }
示例#2
0
        public static RiskV1AddressVerificationsPost201Response Run()
        {
            string clientReferenceInformationCode     = "addressEg";
            string clientReferenceInformationComments = "dav-error response check";
            Riskv1decisionsClientReferenceInformation clientReferenceInformation = new Riskv1decisionsClientReferenceInformation(
                Code: clientReferenceInformationCode,
                Comments: clientReferenceInformationComments
                );

            string orderInformationBillToAddress1           = "Apt C ";
            string orderInformationBillToAddress2           = "";
            string orderInformationBillToAdministrativeArea = "CA";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "Glendale";
            string orderInformationBillToPostalCode         = "91204";
            Riskv1addressverificationsOrderInformationBillTo orderInformationBillTo = new Riskv1addressverificationsOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                Address2: orderInformationBillToAddress2,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode
                );

            Riskv1addressverificationsOrderInformation orderInformation = new Riskv1addressverificationsOrderInformation(
                BillTo: orderInformationBillTo
                );

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

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

                var apiInstance = new VerificationApi(clientConfig);
                RiskV1AddressVerificationsPost201Response result = apiInstance.VerifyCustomerAddress(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        public static RiskV1AddressVerificationsPost201Response Run()
        {
            string clientReferenceInformationCode               = "addressEg";
            string clientReferenceInformationComments           = "dav-All fields";
            string clientReferenceInformationPartnerDeveloperId = "7891234";
            string clientReferenceInformationPartnerSolutionId  = "89012345";
            Riskv1decisionsClientReferenceInformationPartner clientReferenceInformationPartner = new Riskv1decisionsClientReferenceInformationPartner(
                DeveloperId: clientReferenceInformationPartnerDeveloperId,
                SolutionId: clientReferenceInformationPartnerSolutionId
                );

            Riskv1decisionsClientReferenceInformation clientReferenceInformation = new Riskv1decisionsClientReferenceInformation(
                Code: clientReferenceInformationCode,
                Comments: clientReferenceInformationComments,
                Partner: clientReferenceInformationPartner
                );

            string orderInformationBillToAddress1           = "12301 research st";
            string orderInformationBillToAddress2           = "1";
            string orderInformationBillToAddress3           = "2";
            string orderInformationBillToAddress4           = "3";
            string orderInformationBillToAdministrativeArea = "TX";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "Austin";
            string orderInformationBillToPostalCode         = "78759";
            Riskv1addressverificationsOrderInformationBillTo orderInformationBillTo = new Riskv1addressverificationsOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                Address2: orderInformationBillToAddress2,
                Address3: orderInformationBillToAddress3,
                Address4: orderInformationBillToAddress4,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode
                );

            string orderInformationShipToAddress1           = "1715 oaks apt # 7";
            string orderInformationShipToAddress2           = " ";
            string orderInformationShipToAddress3           = "";
            string orderInformationShipToAddress4           = "";
            string orderInformationShipToAdministrativeArea = "WI";
            string orderInformationShipToCountry            = "US";
            string orderInformationShipToLocality           = "SUPERIOR";
            string orderInformationShipToPostalCode         = "29681";
            Riskv1addressverificationsOrderInformationShipTo orderInformationShipTo = new Riskv1addressverificationsOrderInformationShipTo(
                Address1: orderInformationShipToAddress1,
                Address2: orderInformationShipToAddress2,
                Address3: orderInformationShipToAddress3,
                Address4: orderInformationShipToAddress4,
                AdministrativeArea: orderInformationShipToAdministrativeArea,
                Country: orderInformationShipToCountry,
                Locality: orderInformationShipToLocality,
                PostalCode: orderInformationShipToPostalCode
                );


            List <Riskv1addressverificationsOrderInformationLineItems> orderInformationLineItems = new List <Riskv1addressverificationsOrderInformationLineItems>();
            string orderInformationLineItemsUnitPrice1   = "120.50";
            int    orderInformationLineItemsQuantity1    = 3;
            string orderInformationLineItemsProductSKU1  = "9966223";
            string orderInformationLineItemsProductName1 = "headset";
            string orderInformationLineItemsProductCode1 = "electronic";

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

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

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

            var requestObj = new VerifyCustomerAddressRequest(
                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);
                RiskV1AddressVerificationsPost201Response result = apiInstance.VerifyCustomerAddress(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        public static RiskV1AddressVerificationsPost201Response Run()
        {
            string clientReferenceInformationCode     = "addressEg";
            string clientReferenceInformationComments = "dav-All fields";
            Riskv1addressverificationsClientReferenceInformation clientReferenceInformation = new Riskv1addressverificationsClientReferenceInformation(
                Code: clientReferenceInformationCode,
                Comments: clientReferenceInformationComments
                );

            string orderInformationBillToAddress1           = "1650 Burton Ave";
            string orderInformationBillToAddress2           = "";
            string orderInformationBillToAddress3           = "";
            string orderInformationBillToAddress4           = "";
            string orderInformationBillToAdministrativeArea = "BC";
            string orderInformationBillToCountry            = "CA";
            string orderInformationBillToLocality           = "VICTORIA";
            string orderInformationBillToPostalCode         = "V8T 2N6";
            Riskv1addressverificationsOrderInformationBillTo orderInformationBillTo = new Riskv1addressverificationsOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                Address2: orderInformationBillToAddress2,
                Address3: orderInformationBillToAddress3,
                Address4: orderInformationBillToAddress4,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode
                );


            List <Riskv1addressverificationsOrderInformationLineItems> orderInformationLineItems = new List <Riskv1addressverificationsOrderInformationLineItems>();
            string orderInformationLineItemsUnitPrice1   = "120.50";
            int    orderInformationLineItemsQuantity1    = 3;
            string orderInformationLineItemsProductSKU1  = "9966223";
            string orderInformationLineItemsProductName1 = "headset";
            string orderInformationLineItemsProductCode1 = "electronic";

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

            Riskv1addressverificationsOrderInformation orderInformation = new Riskv1addressverificationsOrderInformation(
                BillTo: orderInformationBillTo,
                LineItems: orderInformationLineItems
                );

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

            var requestObj = new VerifyCustomerAddressRequest(
                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);
                RiskV1AddressVerificationsPost201Response result = apiInstance.VerifyCustomerAddress(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        /// <summary>
        /// Verify customer address This call verifies that the customer address submitted is valid.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyCustomerAddressRequest"></param>
        /// <returns>Task of ApiResponse (RiskV1AddressVerificationsPost201Response)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <RiskV1AddressVerificationsPost201Response> > VerifyCustomerAddressAsyncWithHttpInfo(VerifyCustomerAddressRequest verifyCustomerAddressRequest)
        {
            // verify the required parameter 'verifyCustomerAddressRequest' is set
            if (verifyCustomerAddressRequest == null)
            {
                throw new ApiException(400, "Missing required parameter 'verifyCustomerAddressRequest' when calling VerificationApi->VerifyCustomerAddress");
            }

            var    localVarPath         = $"/risk/v1/address-verifications";
            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 (verifyCustomerAddressRequest != null && verifyCustomerAddressRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(verifyCustomerAddressRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = verifyCustomerAddressRequest; // 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("VerifyCustomerAddress", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <RiskV1AddressVerificationsPost201Response>(localVarStatusCode,
                                                                               localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                               (RiskV1AddressVerificationsPost201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AddressVerificationsPost201Response))));
        }
        /// <summary>
        /// Verify customer address This call verifies that the customer address submitted is valid.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyCustomerAddressRequest"></param>
        /// <returns>Task of RiskV1AddressVerificationsPost201Response</returns>
        public async System.Threading.Tasks.Task <RiskV1AddressVerificationsPost201Response> VerifyCustomerAddressAsync(VerifyCustomerAddressRequest verifyCustomerAddressRequest)
        {
            ApiResponse <RiskV1AddressVerificationsPost201Response> localVarResponse = await VerifyCustomerAddressAsyncWithHttpInfo(verifyCustomerAddressRequest);

            return(localVarResponse.Data);
        }
        /// <summary>
        /// Verify customer address This call verifies that the customer address submitted is valid.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyCustomerAddressRequest"></param>
        /// <returns>RiskV1AddressVerificationsPost201Response</returns>
        public RiskV1AddressVerificationsPost201Response VerifyCustomerAddress(VerifyCustomerAddressRequest verifyCustomerAddressRequest)
        {
            ApiResponse <RiskV1AddressVerificationsPost201Response> localVarResponse = VerifyCustomerAddressWithHttpInfo(verifyCustomerAddressRequest);

            return(localVarResponse.Data);
        }
        /// <summary>
        /// Verify customer address This call verifies that the customer address submitted is valid.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyCustomerAddressRequest"></param>
        /// <returns>Task of RiskV1AddressVerificationsPost201Response</returns>
        public async System.Threading.Tasks.Task <RiskV1AddressVerificationsPost201Response> VerifyCustomerAddressAsync(VerifyCustomerAddressRequest verifyCustomerAddressRequest)
        {
            logger.Debug("CALLING API \"VerifyCustomerAddressAsync\" STARTED");
            this.SetStatusCode(null);
            ApiResponse <RiskV1AddressVerificationsPost201Response> localVarResponse = await VerifyCustomerAddressAsyncWithHttpInfo(verifyCustomerAddressRequest);

            logger.Debug("CALLING API \"VerifyCustomerAddressAsync\" ENDED");
            this.SetStatusCode(localVarResponse.StatusCode);
            return(localVarResponse.Data);
        }
        /// <summary>
        /// Verify customer address This call verifies that the customer address submitted is valid.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="verifyCustomerAddressRequest"></param>
        /// <returns>ApiResponse of RiskV1AddressVerificationsPost201Response</returns>
        public ApiResponse <RiskV1AddressVerificationsPost201Response> VerifyCustomerAddressWithHttpInfo(VerifyCustomerAddressRequest verifyCustomerAddressRequest)
        {
            LogUtility logUtility = new LogUtility();

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

            var    localVarPath         = $"/risk/v1/address-verifications";
            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 (verifyCustomerAddressRequest != null && verifyCustomerAddressRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(verifyCustomerAddressRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = verifyCustomerAddressRequest; // 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("VerifyCustomerAddress", localVarResponse);
                if (exception != null)
                {
                    logger.Error($"Exception : {exception.Message}");
                    throw exception;
                }
            }

            return(new ApiResponse <RiskV1AddressVerificationsPost201Response>(localVarStatusCode,
                                                                               localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                               (RiskV1AddressVerificationsPost201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1AddressVerificationsPost201Response)))); // Return statement
        }
示例#10
0
        public static RiskV1AddressVerificationsPost201Response Run()
        {
            string clientReferenceInformationCode     = "addressEg";
            string clientReferenceInformationComments = "dav-error response check";
            Riskv1liststypeentriesClientReferenceInformation clientReferenceInformation = new Riskv1liststypeentriesClientReferenceInformation(
                Code: clientReferenceInformationCode,
                Comments: clientReferenceInformationComments
                );

            string orderInformationBillToAddress1           = "6th 4th ave";
            string orderInformationBillToAddress2           = "";
            string orderInformationBillToAdministrativeArea = "NY";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "rensslaer";
            string orderInformationBillToPostalCode         = "12144";
            Riskv1addressverificationsOrderInformationBillTo orderInformationBillTo = new Riskv1addressverificationsOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                Address2: orderInformationBillToAddress2,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                PostalCode: orderInformationBillToPostalCode
                );


            List <Riskv1addressverificationsOrderInformationLineItems> orderInformationLineItems = new List <Riskv1addressverificationsOrderInformationLineItems>();
            string orderInformationLineItemsUnitPrice1   = "120.50";
            int    orderInformationLineItemsQuantity1    = 3;
            string orderInformationLineItemsProductSKU1  = "996633";
            string orderInformationLineItemsProductName1 = "qwerty";
            string orderInformationLineItemsProductCode1 = "handling";

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

            Riskv1addressverificationsOrderInformation orderInformation = new Riskv1addressverificationsOrderInformation(
                BillTo: orderInformationBillTo,
                LineItems: orderInformationLineItems
                );

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

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

                var apiInstance = new VerificationApi(clientConfig);
                RiskV1AddressVerificationsPost201Response result = apiInstance.VerifyCustomerAddress(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }