Beispiel #1
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var profileId = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            var tokenId   = "7020000000000137654";

            var requestObj = new Body1();

            var processingInformationObj = new InstrumentidentifiersProcessingInformation();

            var authorizationOptionsObj = new InstrumentidentifiersProcessingInformationAuthorizationOptions();

            var initiatorObj = new InstrumentidentifiersProcessingInformationAuthorizationOptionsInitiator();

            var merchantInitiatedTransactionObj = new InstrumentidentifiersProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction();

            merchantInitiatedTransactionObj.PreviousTransactionId = "123456789012345";
            initiatorObj.MerchantInitiatedTransaction             = merchantInitiatedTransactionObj;

            authorizationOptionsObj.Initiator = initiatorObj;

            processingInformationObj.AuthorizationOptions = authorizationOptionsObj;

            requestObj.ProcessingInformation = processingInformationObj;

            try
            {
                var apiInstance = new InstrumentIdentifierApi();
                var result      = apiInstance.InstrumentidentifiersTokenIdPatch(profileId, tokenId, requestObj);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
        public static Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier Run()
        {
            var    profileid                = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            string bankAccountNumber        = "4100";
            string bankAccountRoutingNumber = "071923284";
            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierBankAccount bankAccount = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierBankAccount(
                Number: bankAccountNumber,
                RoutingNumber: bankAccountRoutingNumber
                );

            var requestObj = new PostInstrumentIdentifierRequest(
                BankAccount: bankAccount
                );

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

                var apiInstance = new InstrumentIdentifierApi(clientConfig);
                Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier result = apiInstance.PostInstrumentIdentifier(requestObj, profileid);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Beispiel #3
0
        public static TmsV1InstrumentIdentifiersPost200Response Run()
        {
            var requestObj = new CreateInstrumentIdentifierRequest();

            var cardObj = new Tmsv1instrumentidentifiersCard
            {
                Number = "1234567123487456"
            };

            requestObj.Card = cardObj;

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

                var result = apiInstance.CreateInstrumentIdentifier("93B32398-AD51-4CC2-A682-EA3E93614EB1", requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
                return(null);
            }
        }
Beispiel #4
0
        public static Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier Run()
        {
            var    profileid           = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            string type                = "enrollable card";
            string cardNumber          = "4111111111111111";
            string cardExpirationMonth = "12";
            string cardExpirationYear  = "2031";
            string cardSecurityCode    = "123";
            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierCard card = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierCard(
                Number: cardNumber,
                ExpirationMonth: cardExpirationMonth,
                ExpirationYear: cardExpirationYear,
                SecurityCode: cardSecurityCode
                );

            string billToAddress1           = "1 Market St";
            string billToLocality           = "San Francisco";
            string billToAdministrativeArea = "CA";
            string billToPostalCode         = "94105";
            string billToCountry            = "US";
            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierBillTo billTo = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierBillTo(
                Address1: billToAddress1,
                Locality: billToLocality,
                AdministrativeArea: billToAdministrativeArea,
                PostalCode: billToPostalCode,
                Country: billToCountry
                );

            var requestObj = new PostInstrumentIdentifierRequest(
                Type: type,
                Card: card,
                BillTo: billTo
                );

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

                var apiInstance = new InstrumentIdentifierApi(clientConfig);
                Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier result = apiInstance.PostInstrumentIdentifier(requestObj, profileid);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Beispiel #5
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var requestObj = new Body();

            var cardObj = new InstrumentidentifiersCard();

            cardObj.Number  = "1234567890987654";
            requestObj.Card = cardObj;

            var processingInformationObj = new InstrumentidentifiersProcessingInformation();

            var authorizationOptionsObj = new InstrumentidentifiersProcessingInformationAuthorizationOptions();

            var initiatorObj = new InstrumentidentifiersProcessingInformationAuthorizationOptionsInitiator();

            var merchantInitiatedTransactionObj = new InstrumentidentifiersProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction();

            merchantInitiatedTransactionObj.PreviousTransactionId = "123456789012345";
            initiatorObj.MerchantInitiatedTransaction             = merchantInitiatedTransactionObj;

            authorizationOptionsObj.Initiator = initiatorObj;

            processingInformationObj.AuthorizationOptions = authorizationOptionsObj;

            requestObj.ProcessingInformation = processingInformationObj;

            var merchantConfig = new MerchantConfig(configDictionary)
            {
                RequestType     = "POST",
                RequestTarget   = "/tms/v1/instrumentidentifiers",
                RequestJsonData = JsonConvert.SerializeObject(requestObj)
            };

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new InstrumentIdentifierApi(configurationSwagger);
                var result = apiInstance.InstrumentidentifiersPost("93B32398-AD51-4CC2-A682-EA3E93614EB1", requestObj);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Beispiel #6
0
        public static void Run()
        {
            var profileId = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            var tokenId   = CreateInstrumentIdentifier.Run().Id;

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

                apiInstance.DeleteInstrumentIdentifier(profileId, tokenId);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
        public static void Run()
        {
            var profileId = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            var tokenId   = CreateInstrumentIdentifier.Run().Id;

            var requestObj = new Body1();

            var processingInformationObj = new Tmsv1instrumentidentifiersProcessingInformation();

            var authorizationOptionsObj = new Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptions();

            var initiatorObj = new Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiator();

            var merchantInitiatedTransactionObj =
                new Tmsv1instrumentidentifiersProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction
            {
                PreviousTransactionId = "123456789012345"
            };

            initiatorObj.MerchantInitiatedTransaction = merchantInitiatedTransactionObj;

            authorizationOptionsObj.Initiator = initiatorObj;

            processingInformationObj.AuthorizationOptions = authorizationOptionsObj;

            requestObj.ProcessingInformation = processingInformationObj;

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

                var result = apiInstance.TmsV1InstrumentidentifiersTokenIdPatch(profileId, tokenId, requestObj);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Beispiel #8
0
        public static Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier Run()
        {
            var profileid = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            var tokenId   = "7010000000016241111";

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

                var apiInstance = new InstrumentIdentifierApi(clientConfig);
                Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifier result = apiInstance.GetInstrumentIdentifier(tokenId, profileid);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        public static void Run()
        {
            string instrumentIdentifierTokenId = "7010000000016241111";
            string processingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransactionPreviousTransactionId = "123456789012345";
            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction processingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction(
                PreviousTransactionId: processingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransactionPreviousTransactionId
                );

            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator processingInformationAuthorizationOptionsInitiator = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptionsInitiator(
                MerchantInitiatedTransaction: processingInformationAuthorizationOptionsInitiatorMerchantInitiatedTransaction
                );

            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptions processingInformationAuthorizationOptions = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformationAuthorizationOptions(
                Initiator: processingInformationAuthorizationOptionsInitiator
                );

            Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformation processingInformation = new Tmsv2customersEmbeddedDefaultPaymentInstrumentEmbeddedInstrumentIdentifierProcessingInformation(
                AuthorizationOptions: processingInformationAuthorizationOptions
                );

            var requestObj = new PatchInstrumentIdentifierRequest(
                ProcessingInformation: processingInformation
                );

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

                var apiInstance = new InstrumentIdentifierApi(clientConfig);
                apiInstance.PatchInstrumentIdentifier(instrumentIdentifierTokenId, requestObj);
                Console.WriteLine($"Instrument Identifier {instrumentIdentifierTokenId} has been updated with previous transaction ID.");
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
            }
        }
Beispiel #10
0
        public static PaymentInstrumentListForCustomer Run()
        {
            string instrumentIdentifierTokenId = "7010000000016241111";
            string profileid = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            long?  offset    = (long?)null;
            long?  limit     = (long?)null;

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

                var apiInstance = new InstrumentIdentifierApi(clientConfig);
                PaymentInstrumentListForCustomer result = apiInstance.GetInstrumentIdentifierPaymentInstrumentsList(instrumentIdentifierTokenId, profileid, offset, limit);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Beispiel #11
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var profileId = "93B32398-AD51-4CC2-A682-EA3E93614EB1";
            var tokenId   = "7020000000000137654";

            var merchantConfig = new MerchantConfig(configDictionary)
            {
                RequestType   = "GET",
                RequestTarget = "/tms/v1/instrumentidentifiers/" + tokenId + "/paymentinstruments"
            };

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new InstrumentIdentifierApi(configurationSwagger);
                var result = apiInstance.InstrumentidentifiersTokenIdPaymentinstrumentsGet(profileId, tokenId);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
 public void Init()
 {
     instance = new InstrumentIdentifierApi();
 }