public static RiskV1DecisionsPost201Response Run()
        {
            var requestObj = new CreateDecisionManagerCaseRequest();

            var clientReferenceInformation = new Riskv1decisionsClientReferenceInformation();

            clientReferenceInformation.Code       = "54323007";
            requestObj.ClientReferenceInformation = clientReferenceInformation;

            var paymentInformation = new Riskv1decisionsPaymentInformation();

            var card = new Riskv1decisionsPaymentInformationCard();

            card.Number             = "4444444444444448";
            card.ExpirationMonth    = "12";
            card.ExpirationYear     = "2020";
            paymentInformation.Card = card;

            requestObj.PaymentInformation = paymentInformation;

            var orderInformation = new Riskv1decisionsOrderInformation();

            var amountDetails = new Riskv1decisionsOrderInformationAmountDetails("USD");

            amountDetails.Currency         = "USD";
            amountDetails.TotalAmount      = "144.14";
            orderInformation.AmountDetails = amountDetails;

            var shipTo = new Riskv1decisionsOrderInformationShipTo();

            shipTo.Address1           = "96, powers street";
            shipTo.Address2           = "";
            shipTo.AdministrativeArea = "KA";
            shipTo.Country            = "INDIA";
            shipTo.Locality           = "Clearwater milford";
            shipTo.FirstName          = "James";
            shipTo.LastName           = "Smith";
            shipTo.PhoneNumber        = "7606160717";
            shipTo.PostalCode         = "560056";
            orderInformation.ShipTo   = shipTo;

            var billTo = new Riskv1decisionsOrderInformationBillTo();

            billTo.Address1           = "96, powers street";
            billTo.AdministrativeArea = "NH";
            billTo.Country            = "US";
            billTo.Locality           = "Clearwater milford";
            billTo.FirstName          = "James";
            billTo.LastName           = "Smith";
            billTo.PhoneNumber        = "7606160717";
            billTo.Email            = "*****@*****.**";
            billTo.PostalCode       = "03055";
            orderInformation.BillTo = billTo;

            requestObj.OrderInformation = orderInformation;

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

                var result = apiInstance.CreateDecisionManagerCase(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Esempio n. 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Riskv1decisionsOrderInformation" /> class.
 /// </summary>
 /// <param name="AmountDetails">AmountDetails.</param>
 /// <param name="PreOrder">Indicates whether cardholder is placing an order with a future availability or release date. This field can contain one of these values: - MERCHANDISE_AVAILABLE: Merchandise available - FUTURE_AVAILABILITY: Future availability .</param>
 /// <param name="PreOrderDate">Expected date that a pre-ordered purchase will be available. Format: YYYYMMDD .</param>
 /// <param name="Reordered">Indicates whether the cardholder is reordering previously purchased merchandise. This field can contain one of these values: - false: First time ordered - true: Reordered .</param>
 /// <param name="ShippingDetails">ShippingDetails.</param>
 /// <param name="ShipTo">ShipTo.</param>
 /// <param name="ReturnsAccepted">Boolean that indicates whether returns are accepted for this order. This field can contain one of the following values: - true: Returns are accepted for this order. - false: Returns are not accepted for this order. .</param>
 /// <param name="LineItems">This array contains detailed information about individual products in the order..</param>
 /// <param name="BillTo">BillTo.</param>
 /// <param name="TotalOffersCount">Total number of articles/items in the order as a numeric decimal count. Possible values: 00 - 99 .</param>
 public Riskv1decisionsOrderInformation(Riskv1decisionsOrderInformationAmountDetails AmountDetails = default(Riskv1decisionsOrderInformationAmountDetails), string PreOrder = default(string), string PreOrderDate = default(string), bool?Reordered = default(bool?), Riskv1decisionsOrderInformationShippingDetails ShippingDetails = default(Riskv1decisionsOrderInformationShippingDetails), Riskv1decisionsOrderInformationShipTo ShipTo = default(Riskv1decisionsOrderInformationShipTo), bool?ReturnsAccepted = default(bool?), List <Riskv1decisionsOrderInformationLineItems> LineItems = default(List <Riskv1decisionsOrderInformationLineItems>), Riskv1decisionsOrderInformationBillTo BillTo = default(Riskv1decisionsOrderInformationBillTo), string TotalOffersCount = default(string))
 {
     this.AmountDetails    = AmountDetails;
     this.PreOrder         = PreOrder;
     this.PreOrderDate     = PreOrderDate;
     this.Reordered        = Reordered;
     this.ShippingDetails  = ShippingDetails;
     this.ShipTo           = ShipTo;
     this.ReturnsAccepted  = ReturnsAccepted;
     this.LineItems        = LineItems;
     this.BillTo           = BillTo;
     this.TotalOffersCount = TotalOffersCount;
 }
Esempio n. 3
0
        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 buyerInformationHashedPassword = "";
            string buyerInformationDateOfBirth    = "19980505";

            List <Ptsv2paymentsBuyerInformationPersonalIdentification> buyerInformationPersonalIdentification = new List <Ptsv2paymentsBuyerInformationPersonalIdentification>();
            string buyerInformationPersonalIdentificationType1 = "CPF";
            string buyerInformationPersonalIdentificationId1   = "1a23apwe98";

            buyerInformationPersonalIdentification.Add(new Ptsv2paymentsBuyerInformationPersonalIdentification(
                                                           Type: buyerInformationPersonalIdentificationType1,
                                                           Id: buyerInformationPersonalIdentificationId1
                                                           ));

            Riskv1decisionsBuyerInformation buyerInformation = new Riskv1decisionsBuyerInformation(
                HashedPassword: buyerInformationHashedPassword,
                DateOfBirth: buyerInformationDateOfBirth,
                PersonalIdentification: buyerInformationPersonalIdentification
                );

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

            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);
            }
        }
Esempio n. 4
0
        public static RiskV1DecisionsPost201Response Run()
        {
            string clientReferenceInformationCode               = "54323007";
            string clientReferenceInformationComments           = "decision manager case";
            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 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
                );

            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()
        {
            var requestObj = new CreateDecisionManagerCaseRequest();

            var clientReferenceInformation = new Riskv1decisionsClientReferenceInformation();

            clientReferenceInformation.Code       = "54323007";
            requestObj.ClientReferenceInformation = clientReferenceInformation;

            var paymentInformation = new Riskv1decisionsPaymentInformation();

            var card = new Riskv1decisionsPaymentInformationCard();

            card.Number             = "4444444444444448";
            card.ExpirationMonth    = "12";
            card.ExpirationYear     = "2020";
            paymentInformation.Card = card;

            requestObj.PaymentInformation = paymentInformation;

            var orderInformation = new Riskv1decisionsOrderInformation();

            var amountDetails = new Riskv1decisionsOrderInformationAmountDetails("USD");

            amountDetails.Currency         = "USD";
            amountDetails.TotalAmount      = "144.14";
            orderInformation.AmountDetails = amountDetails;

            var billTo = new Riskv1decisionsOrderInformationBillTo();

            billTo.Address1           = "96, powers street";
            billTo.AdministrativeArea = "NH";
            billTo.Country            = "US";
            billTo.Locality           = "Clearwater milford";
            billTo.FirstName          = "James";
            billTo.LastName           = "Smith";
            billTo.PhoneNumber        = "7606160717";
            billTo.Email            = "*****@*****.**";
            billTo.PostalCode       = "03055";
            orderInformation.BillTo = billTo;

            requestObj.OrderInformation = orderInformation;

            var travelInformation = new Riskv1decisionsTravelInformation();

            travelInformation.CompleteRoute = "SFO-JFK:JFK-BLR";
            travelInformation.DepartureTime = "2011-03-20 11:30pm GMT";
            travelInformation.JourneyType   = "One way";
            var legs = new List <Riskv1decisionsTravelInformationLegs>();

            var legs0 = new Riskv1decisionsTravelInformationLegs();

            legs0.Origination = "SFO";
            legs0.Destination = "JFK";
            legs.Add(legs0);

            var legs1 = new Riskv1decisionsTravelInformationLegs();

            legs1.Origination = "JFK";
            legs1.Destination = "BLR";
            legs.Add(legs1);

            travelInformation.Legs = legs;

            requestObj.TravelInformation = travelInformation;

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

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