public static RiskV1UpdatePost201Response Run() { string type = "positive"; string orderInformationAddressAddress1 = "1234 Sample St."; string orderInformationAddressAddress2 = "Mountain View"; string orderInformationAddressLocality = "California"; string orderInformationAddressCountry = "US"; string orderInformationAddressAdministrativeArea = "CA"; string orderInformationAddressPostalCode = "94043"; Riskv1liststypeentriesOrderInformationAddress orderInformationAddress = new Riskv1liststypeentriesOrderInformationAddress( Address1: orderInformationAddressAddress1, Address2: orderInformationAddressAddress2, Locality: orderInformationAddressLocality, Country: orderInformationAddressCountry, AdministrativeArea: orderInformationAddressAdministrativeArea, PostalCode: orderInformationAddressPostalCode ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Doe"; string orderInformationBillToEmail = "*****@*****.**"; Riskv1liststypeentriesOrderInformationBillTo orderInformationBillTo = new Riskv1liststypeentriesOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Email: orderInformationBillToEmail ); Riskv1liststypeentriesOrderInformation orderInformation = new Riskv1liststypeentriesOrderInformation( Address: orderInformationAddress, BillTo: orderInformationBillTo ); Riskv1liststypeentriesPaymentInformation paymentInformation = new Riskv1liststypeentriesPaymentInformation( ); string clientReferenceInformationCode = "54323007"; Riskv1decisionsClientReferenceInformation clientReferenceInformation = new Riskv1decisionsClientReferenceInformation( Code: clientReferenceInformationCode ); string riskInformationMarkingDetailsAction = "add"; Riskv1liststypeentriesRiskInformationMarkingDetails riskInformationMarkingDetails = new Riskv1liststypeentriesRiskInformationMarkingDetails( Action: riskInformationMarkingDetailsAction ); Riskv1liststypeentriesRiskInformation riskInformation = new Riskv1liststypeentriesRiskInformation( MarkingDetails: riskInformationMarkingDetails ); var requestObj = new AddNegativeListRequest( OrderInformation: orderInformation, PaymentInformation: paymentInformation, ClientReferenceInformation: clientReferenceInformation, RiskInformation: riskInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new DecisionManagerApi(clientConfig); RiskV1UpdatePost201Response result = apiInstance.AddNegative(type, requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
/// <summary> /// List Management This call adds/deletes/converts the request information in the negative list. Provide the list to be updated as the path parameter. This value can be 'postiive', 'negative' or 'review'. /// </summary> /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="type">The list to be updated. It can be 'positive', 'negative' or 'review'.</param> /// <param name="addNegativeListRequest"></param> /// <returns>Task of RiskV1UpdatePost201Response</returns> public async System.Threading.Tasks.Task <RiskV1UpdatePost201Response> AddNegativeAsync(string type, AddNegativeListRequest addNegativeListRequest) { ApiResponse <RiskV1UpdatePost201Response> localVarResponse = await AddNegativeAsyncWithHttpInfo(type, addNegativeListRequest); return(localVarResponse.Data); }
/// <summary> /// List Management This call adds/deletes/converts the request information in the negative list. Provide the list to be updated as the path parameter. This value can be 'postiive', 'negative' or 'review'. /// </summary> /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="type">The list to be updated. It can be 'positive', 'negative' or 'review'.</param> /// <param name="addNegativeListRequest"></param> /// <returns>Task of ApiResponse (RiskV1UpdatePost201Response)</returns> public async System.Threading.Tasks.Task <ApiResponse <RiskV1UpdatePost201Response> > AddNegativeAsyncWithHttpInfo(string type, AddNegativeListRequest addNegativeListRequest) { // verify the required parameter 'type' is set if (type == null) { throw new ApiException(400, "Missing required parameter 'type' when calling DecisionManagerApi->AddNegative"); } // verify the required parameter 'addNegativeListRequest' is set if (addNegativeListRequest == null) { throw new ApiException(400, "Missing required parameter 'addNegativeListRequest' when calling DecisionManagerApi->AddNegative"); } var localVarPath = $"/risk/v1/lists/{type}/entries"; 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 (type != null) { localVarPathParams.Add("type", Configuration.ApiClient.ParameterToString(type)); // path parameter } if (addNegativeListRequest != null && addNegativeListRequest.GetType() != typeof(byte[])) { localVarPostBody = Configuration.ApiClient.Serialize(addNegativeListRequest); // http body (model) parameter } else { localVarPostBody = addNegativeListRequest; // 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("AddNegative", localVarResponse); if (exception != null) { throw exception; } } return(new ApiResponse <RiskV1UpdatePost201Response>(localVarStatusCode, localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()), (RiskV1UpdatePost201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1UpdatePost201Response)))); }
/// <summary> /// List Management This call adds/deletes/converts the request information in the negative list. Provide the list to be updated as the path parameter. This value can be 'postiive', 'negative' or 'review'. /// </summary> /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="type">The list to be updated. It can be 'positive', 'negative' or 'review'.</param> /// <param name="addNegativeListRequest"></param> /// <returns>RiskV1UpdatePost201Response</returns> public RiskV1UpdatePost201Response AddNegative(string type, AddNegativeListRequest addNegativeListRequest) { ApiResponse <RiskV1UpdatePost201Response> localVarResponse = AddNegativeWithHttpInfo(type, addNegativeListRequest); return(localVarResponse.Data); }