public static RiskV1DecisionsPost201Response Run()
        {
            string clientReferenceInformationCode = "54323007";
            Riskv1decisionsClientReferenceInformation clientReferenceInformation = new Riskv1decisionsClientReferenceInformation(
                Code: clientReferenceInformationCode
                );

            string paymentInformationCardNumber          = "4444444444444448";
            string paymentInformationCardExpirationMonth = "12";
            string paymentInformationCardExpirationYear  = "2020";
            Riskv1decisionsPaymentInformationCard paymentInformationCard = new Riskv1decisionsPaymentInformationCard(
                Number: paymentInformationCardNumber,
                ExpirationMonth: paymentInformationCardExpirationMonth,
                ExpirationYear: paymentInformationCardExpirationYear
                );

            Riskv1decisionsPaymentInformation paymentInformation = new Riskv1decisionsPaymentInformation(
                Card: paymentInformationCard
                );

            string orderInformationAmountDetailsCurrency    = "USD";
            string orderInformationAmountDetailsTotalAmount = "144.14";
            Riskv1decisionsOrderInformationAmountDetails orderInformationAmountDetails = new Riskv1decisionsOrderInformationAmountDetails(
                Currency: orderInformationAmountDetailsCurrency,
                TotalAmount: orderInformationAmountDetailsTotalAmount
                );

            string orderInformationShipToAddress1           = "96, powers street";
            string orderInformationShipToAddress2           = "";
            string orderInformationShipToAdministrativeArea = "KA";
            string orderInformationShipToCountry            = "IN";
            string orderInformationShipToLocality           = "Clearwater milford";
            string orderInformationShipToFirstName          = "James";
            string orderInformationShipToLastName           = "Smith";
            string orderInformationShipToPhoneNumber        = "7606160717";
            string orderInformationShipToPostalCode         = "560056";
            Riskv1decisionsOrderInformationShipTo orderInformationShipTo = new Riskv1decisionsOrderInformationShipTo(
                Address1: orderInformationShipToAddress1,
                Address2: orderInformationShipToAddress2,
                AdministrativeArea: orderInformationShipToAdministrativeArea,
                Country: orderInformationShipToCountry,
                Locality: orderInformationShipToLocality,
                FirstName: orderInformationShipToFirstName,
                LastName: orderInformationShipToLastName,
                PhoneNumber: orderInformationShipToPhoneNumber,
                PostalCode: orderInformationShipToPostalCode
                );

            string orderInformationBillToAddress1           = "96, powers street";
            string orderInformationBillToAdministrativeArea = "NH";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "Clearwater milford";
            string orderInformationBillToFirstName          = "James";
            string orderInformationBillToLastName           = "Smith";
            string orderInformationBillToPhoneNumber        = "7606160717";
            string orderInformationBillToEmail      = "*****@*****.**";
            string orderInformationBillToPostalCode = "03055";
            Riskv1decisionsOrderInformationBillTo orderInformationBillTo = new Riskv1decisionsOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                FirstName: orderInformationBillToFirstName,
                LastName: orderInformationBillToLastName,
                PhoneNumber: orderInformationBillToPhoneNumber,
                Email: orderInformationBillToEmail,
                PostalCode: orderInformationBillToPostalCode
                );

            Riskv1decisionsOrderInformation orderInformation = new Riskv1decisionsOrderInformation(
                AmountDetails: orderInformationAmountDetails,
                ShipTo: orderInformationShipTo,
                BillTo: orderInformationBillTo
                );

            var requestObj = new CreateBundledDecisionManagerCaseRequest(
                ClientReferenceInformation: clientReferenceInformation,
                PaymentInformation: paymentInformation,
                OrderInformation: orderInformation
                );

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

                var apiInstance = new DecisionManagerApi(clientConfig);
                RiskV1DecisionsPost201Response result = apiInstance.CreateBundledDecisionManagerCase(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        public static RiskV1DecisionsPost201Response Run()
        {
            string clientReferenceInformationCode = "54323007";
            Riskv1decisionsClientReferenceInformation clientReferenceInformation = new Riskv1decisionsClientReferenceInformation(
                Code: clientReferenceInformationCode
                );

            string paymentInformationCardNumber          = "4444444444444448";
            string paymentInformationCardExpirationMonth = "12";
            string paymentInformationCardExpirationYear  = "2020";
            Riskv1decisionsPaymentInformationCard paymentInformationCard = new Riskv1decisionsPaymentInformationCard(
                Number: paymentInformationCardNumber,
                ExpirationMonth: paymentInformationCardExpirationMonth,
                ExpirationYear: paymentInformationCardExpirationYear
                );

            Riskv1decisionsPaymentInformation paymentInformation = new Riskv1decisionsPaymentInformation(
                Card: paymentInformationCard
                );

            string orderInformationAmountDetailsCurrency    = "USD";
            string orderInformationAmountDetailsTotalAmount = "144.14";
            Riskv1decisionsOrderInformationAmountDetails orderInformationAmountDetails = new Riskv1decisionsOrderInformationAmountDetails(
                Currency: orderInformationAmountDetailsCurrency,
                TotalAmount: orderInformationAmountDetailsTotalAmount
                );

            string orderInformationBillToAddress1           = "96, powers street";
            string orderInformationBillToAdministrativeArea = "NH";
            string orderInformationBillToCountry            = "US";
            string orderInformationBillToLocality           = "Clearwater milford";
            string orderInformationBillToFirstName          = "James";
            string orderInformationBillToLastName           = "Smith";
            string orderInformationBillToPhoneNumber        = "7606160717";
            string orderInformationBillToEmail      = "*****@*****.**";
            string orderInformationBillToPostalCode = "03055";
            Riskv1decisionsOrderInformationBillTo orderInformationBillTo = new Riskv1decisionsOrderInformationBillTo(
                Address1: orderInformationBillToAddress1,
                AdministrativeArea: orderInformationBillToAdministrativeArea,
                Country: orderInformationBillToCountry,
                Locality: orderInformationBillToLocality,
                FirstName: orderInformationBillToFirstName,
                LastName: orderInformationBillToLastName,
                PhoneNumber: orderInformationBillToPhoneNumber,
                Email: orderInformationBillToEmail,
                PostalCode: orderInformationBillToPostalCode
                );

            Riskv1decisionsOrderInformation orderInformation = new Riskv1decisionsOrderInformation(
                AmountDetails: orderInformationAmountDetails,
                BillTo: orderInformationBillTo
                );

            string travelInformationCompleteRoute = "SFO-JFK:JFK-BLR";
            string travelInformationDepartureTime = "2011-03-20 11:30pm GMT";
            string travelInformationJourneyType   = "One way";

            List <Riskv1decisionsTravelInformationLegs> travelInformationLegs = new List <Riskv1decisionsTravelInformationLegs>();
            string travelInformationLegsOrigination1 = "SFO";
            string travelInformationLegsDestination1 = "JFK";

            travelInformationLegs.Add(new Riskv1decisionsTravelInformationLegs(
                                          Origination: travelInformationLegsOrigination1,
                                          Destination: travelInformationLegsDestination1
                                          ));

            string travelInformationLegsOrigination2 = "JFK";
            string travelInformationLegsDestination2 = "BLR";

            travelInformationLegs.Add(new Riskv1decisionsTravelInformationLegs(
                                          Origination: travelInformationLegsOrigination2,
                                          Destination: travelInformationLegsDestination2
                                          ));

            Riskv1decisionsTravelInformation travelInformation = new Riskv1decisionsTravelInformation(
                CompleteRoute: travelInformationCompleteRoute,
                DepartureTime: travelInformationDepartureTime,
                JourneyType: travelInformationJourneyType,
                Legs: travelInformationLegs
                );

            var requestObj = new CreateBundledDecisionManagerCaseRequest(
                ClientReferenceInformation: clientReferenceInformation,
                PaymentInformation: paymentInformation,
                OrderInformation: orderInformation,
                TravelInformation: travelInformation
                );

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

                var apiInstance = new DecisionManagerApi(clientConfig);
                RiskV1DecisionsPost201Response result = apiInstance.CreateBundledDecisionManagerCase(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Exemple #3
0
        /// <summary>
        /// Create Decision Manager Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createBundledDecisionManagerCaseRequest"></param>
        /// <returns>Task of RiskV1DecisionsPost201Response</returns>
        public async System.Threading.Tasks.Task <RiskV1DecisionsPost201Response> CreateBundledDecisionManagerCaseAsync(CreateBundledDecisionManagerCaseRequest createBundledDecisionManagerCaseRequest)
        {
            ApiResponse <RiskV1DecisionsPost201Response> localVarResponse = await CreateBundledDecisionManagerCaseAsyncWithHttpInfo(createBundledDecisionManagerCaseRequest);

            return(localVarResponse.Data);
        }
Exemple #4
0
        /// <summary>
        /// Create Decision Manager Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createBundledDecisionManagerCaseRequest"></param>
        /// <returns>Task of ApiResponse (RiskV1DecisionsPost201Response)</returns>
        public async System.Threading.Tasks.Task <ApiResponse <RiskV1DecisionsPost201Response> > CreateBundledDecisionManagerCaseAsyncWithHttpInfo(CreateBundledDecisionManagerCaseRequest createBundledDecisionManagerCaseRequest)
        {
            // verify the required parameter 'createBundledDecisionManagerCaseRequest' is set
            if (createBundledDecisionManagerCaseRequest == null)
            {
                throw new ApiException(400, "Missing required parameter 'createBundledDecisionManagerCaseRequest' when calling DecisionManagerApi->CreateBundledDecisionManagerCase");
            }

            var    localVarPath         = $"/risk/v1/decisions";
            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 (createBundledDecisionManagerCaseRequest != null && createBundledDecisionManagerCaseRequest.GetType() != typeof(byte[]))
            {
                localVarPostBody = Configuration.ApiClient.Serialize(createBundledDecisionManagerCaseRequest); // http body (model) parameter
            }
            else
            {
                localVarPostBody = createBundledDecisionManagerCaseRequest; // byte array
            }

            if (false)
            {
            }
            else
            {
            }


            // 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("CreateBundledDecisionManagerCase", localVarResponse);
                if (exception != null)
                {
                    throw exception;
                }
            }

            return(new ApiResponse <RiskV1DecisionsPost201Response>(localVarStatusCode,
                                                                    localVarResponse.Headers.ToDictionary(x => x.Name, x => x.Value.ToString()),
                                                                    (RiskV1DecisionsPost201Response)Configuration.ApiClient.Deserialize(localVarResponse, typeof(RiskV1DecisionsPost201Response)))); // Return statement
        }
Exemple #5
0
        /// <summary>
        /// Create Decision Manager Decision Manager can help you automate and streamline your fraud operations. Decision Manager will return a decision based on the request values.
        /// </summary>
        /// <exception cref="CyberSource.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="createBundledDecisionManagerCaseRequest"></param>
        /// <returns>RiskV1DecisionsPost201Response</returns>
        public RiskV1DecisionsPost201Response CreateBundledDecisionManagerCase(CreateBundledDecisionManagerCaseRequest createBundledDecisionManagerCaseRequest)
        {
            ApiResponse <RiskV1DecisionsPost201Response> localVarResponse = CreateBundledDecisionManagerCaseWithHttpInfo(createBundledDecisionManagerCaseRequest);

            return(localVarResponse.Data);
        }