public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "TC45555-1" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var consumerAuthenticationInformationObj = new V2paymentsConsumerAuthenticationInformation { Cavv = "EHuWW9PiBkWvqE5juRwDzAUFBAk=", UcafCollectionIndicator = "2", UcafAuthenticationData = "EHuWW9PiBkWvqE5juRwDzAUFBAk" }; requestObj.ConsumerAuthenticationInformation = consumerAuthenticationInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation { CommerceIndicator = "spa" }; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "SG", LastName = "Deo", Address2 = "test", Address1 = "201 S. Division St.", PostalCode = "48104-2201", Locality = "Ann Arbor", AdministrativeArea = "MI", FirstName = "John", PhoneNumber = "999999999", District = "MI", BuildingNumber = "123", Company = "Visa", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "2016.05", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "5641821111166669", SecurityCode = "123", ExpirationMonth = "12", Type = "042" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "1234567890" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsDeviceInformationObj = new V2paymentsDeviceInformation { IpAddress = "66.185.179.2" }; requestObj.DeviceInformation = v2PaymentsDeviceInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation { Capture = true }; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", FirstName = "John", LastName = "Deo", PhoneNumber = "6504327113", Address2 = "Desk M3-5573", Address1 = "901 Metro Center Blvd", PostalCode = "94404", Locality = "Foster City", Company = "Visa", AdministrativeArea = "CA", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var v2PaymentsOrderInformationAmountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "2201", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = v2PaymentsOrderInformationAmountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "4111111111111111", SecurityCode = "123", ExpirationMonth = "12" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "TC50171_7" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation { CommerceIndicator = "recurring" }; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsAggregatorInformationObj = new V2paymentsAggregatorInformation(); var v2PaymentsAggregatorInformationSubMerchantObj = new V2paymentsAggregatorInformationSubMerchant { CardAcceptorId = "1234567890", Country = "US", PhoneNumber = "650-432-0000", Address1 = "900 Metro Center", PostalCode = "94404-2775", Locality = "Foster City", Name = "Visa Inc", AdministrativeArea = "CA", Region = "PEN", Email = "*****@*****.**" }; v2PaymentsAggregatorInformationObj.SubMerchant = v2PaymentsAggregatorInformationSubMerchantObj; v2PaymentsAggregatorInformationObj.Name = "V-Internatio"; v2PaymentsAggregatorInformationObj.AggregatorId = "123456789"; requestObj.AggregatorInformation = v2PaymentsAggregatorInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", LastName = "Deo", Address2 = "Address 2", Address1 = "201 S. Division St.", PostalCode = "48104-2201", Locality = "Ann Arbor", AdministrativeArea = "MI", FirstName = "John", PhoneNumber = "999999999", District = "MI", BuildingNumber = "123", Company = "Visa", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "106.00", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "5555555555554444", SecurityCode = "123", ExpirationMonth = "12", Type = "002" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "1234567890" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsPointOfSaleInformationObj = new V2paymentsPointOfSaleInformation { CardPresent = false, CatLevel = 6, TerminalCapability = 4 }; requestObj.PointOfSaleInformation = v2PaymentsPointOfSaleInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", FirstName = "John", LastName = "Deo", Address1 = "901 Metro Center Blvd", PostalCode = "40500", Locality = "Foster City", AdministrativeArea = "CA", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "100.00", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "4111111111111111", SecurityCode = "123", ExpirationMonth = "12" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "33557799" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsPointOfSaleInformationObj = new V2paymentsPointOfSaleInformation { TerminalId = "terminal", CardPresent = true }; var emvObj = new V2paymentsPointOfSaleInformationEmv { CardSequenceNumber = "123", Tags = "9C01019A031207109F33036040209F1A0207849F370482766E409F3602001F82025C009F2608EF7753429A5D16B19F100706010A03A00000950580000400009F02060000000700009F6E0482766E409F5B04123456789F2701809F3403AB12349F0902AB129F4104AB1234AB9F0702AB129F0610123456789012345678901234567890AB9F030200005F2A0207849F7C031234569F350123" }; v2PaymentsPointOfSaleInformationObj.Emv = emvObj; v2PaymentsPointOfSaleInformationObj.EntryMode = "QRCode"; v2PaymentsPointOfSaleInformationObj.TerminalCapability = 4; requestObj.PointOfSaleInformation = v2PaymentsPointOfSaleInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation { CommerceIndicator = "retail", PaymentSolution = "012" }; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", LastName = "Deo", Address2 = "test", Address1 = "201 S. Division St.", PostalCode = "48104-2201", Locality = "Ann Arbor", AdministrativeArea = "MI", FirstName = "John", PhoneNumber = "999999999", District = "MI", BuildingNumber = "123", Company = "Visa", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "100.00", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var tokenizedCardObj = new V2paymentsPaymentInformationTokenizedCard { TransactionType = "1", RequestorId = "12345678901" }; v2PaymentsPaymentInformationObj.TokenizedCard = tokenizedCardObj; var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { Type = "001" }; // v2paymentsPaymentInformationCardObj.TrackData = ";4111111111111111=21121019761186800000?"; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "TC1102345" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var deviceInformationObj = new V2paymentsDeviceInformation { HostName = "cybersource.com", IpAddress = "66.185.179.2" }; requestObj.DeviceInformation = deviceInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation(); var authorizationOptionsObj = new V2paymentsProcessingInformationAuthorizationOptions { IgnoreAvsResult = true, IgnoreCvResult = false }; v2PaymentsProcessingInformationObj.AuthorizationOptions = authorizationOptionsObj; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var buyerInformationObj = new V2paymentsBuyerInformation(); var list = new List <V2paymentsBuyerInformationPersonalIdentification>(); var personalIdentificationObj = new V2paymentsBuyerInformationPersonalIdentification { Id = "123* 4sÆ" }; list.Add(personalIdentificationObj); buyerInformationObj.PersonalIdentification = list; requestObj.BuyerInformation = buyerInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", LastName = "Deo", Address2 = "test", Address1 = "201 S. Division St.", PostalCode = "48104-2201", Locality = "Ann Arbor", AdministrativeArea = "MI", FirstName = "John", PhoneNumber = "999999999", District = "MI", BuildingNumber = "123", Company = "Visa", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "2401", Currency = "usd" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "372425119311008", SecurityCode = "1111", ExpirationMonth = "12", Type = "003", SecurityCodeIndicator = "1" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "demomerchant" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsPointOfSaleInformationObj = new V2paymentsPointOfSaleInformation { CardPresent = true, CatLevel = 1, EntryMode = "keyed", TerminalCapability = 2 }; requestObj.PointOfSaleInformation = v2PaymentsPointOfSaleInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation { CommerceIndicator = "retail" }; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", LastName = "Deo", Address1 = "201 S. Division St.", PostalCode = "48104-2201", Locality = "Ann Arbor", AdministrativeArea = "MI", FirstName = "John", PhoneNumber = "999999999", District = "MI", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "100.00", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2050", ExpirationMonth = "12" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; var v2PaymentsPaymentInformationFluidDataObj = new V2paymentsPaymentInformationFluidData { Descriptor = "Ymx1ZWZpbg==", Value = "02d700801f3c20008383252a363031312a2a2a2a2a2a2a2a303030395e46444d53202020202020202020202020202020202020202020205e323231322a2a2a2a2a2a2a2a3f2a3b363031312a2a2a2a2a2a2a2a303030393d323231322a2a2a2a2a2a2a2a3f2a7a75ad15d25217290c54b3d9d1c3868602136c68d339d52d98423391f3e631511d548fff08b414feac9ff6c6dede8fb09bae870e4e32f6f462d6a75fa0a178c3bd18d0d3ade21bc7a0ea687a2eef64551751e502d97cb98dc53ea55162cdfa395431323439323830303762994901000001a000731a8003" }; v2PaymentsPaymentInformationObj.FluidData = v2PaymentsPaymentInformationFluidDataObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation(); var authorizationOptionsObj = new V2paymentsProcessingInformationAuthorizationOptions { DeclineAvsFlags = new List <V2paymentsProcessingInformationAuthorizationOptions.DeclineAvsFlagsEnum>() { V2paymentsProcessingInformationAuthorizationOptions.DeclineAvsFlagsEnum.N } }; v2PaymentsProcessingInformationObj.AuthorizationOptions = authorizationOptionsObj; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", FirstName = "John", LastName = "Deo", Address1 = "901 Metro Center Blvd", PostalCode = "48104", Locality = "Foster City", AdministrativeArea = "CA", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var v2PaymentsOrderInformationAmountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "2861", Currency = "USD" }; v2PaymentsOrderInformationObj.AmountDetails = v2PaymentsOrderInformationAmountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "4111111111111111", SecurityCode = "123", ExpirationMonth = "12" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary<string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "TC54853-4" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsProcessingInformationObj = new V2paymentsProcessingInformation { Capture = true, CommerceIndicator = "JS" }; requestObj.ProcessingInformation = v2PaymentsProcessingInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", FirstName = "John", LastName = "Deo", PhoneNumber = "6504327113", Address2 = "Desk M3-5573", Address1 = "901 Metro Center Blvd", PostalCode = "94404", Locality = "Foster City", Company = "Visa", AdministrativeArea = "CA", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var v2PaymentsOrderInformationAmountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "100", Currency = "JPY" }; v2PaymentsOrderInformationObj.AmountDetails = v2PaymentsOrderInformationAmountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "3540599999991047", SecurityCode = "123", ExpirationMonth = "12", Type = "007" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var consumerAuthenticationInformationObj = new V2paymentsConsumerAuthenticationInformation { Cavv = "EHuWW9PiBkWvqE5juRwDzAUFBAk=", EciRaw = "05", Xid = "lEmYpm61EduaVZjPG1/HsgkAAQc=" }; requestObj.ConsumerAuthenticationInformation = consumerAuthenticationInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }
public static void Run(IReadOnlyDictionary <string, string> configDictionary) { var requestObj = new CreatePaymentRequest(); var v2PaymentsClientReferenceInformationObj = new V2paymentsClientReferenceInformation { Code = "123456" }; requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj; var v2PaymentsPointOfSaleInformationObj = new V2paymentsPointOfSaleInformation { CardPresent = true, CatLevel = 2, TerminalCapability = 4 }; // var emvObj = new V2paymentsPointOfSaleInformationEmv(); // emvObj.FallbackCondition = "swiped"; // emvObj.Fallback = "Y"; // v2paymentsPointOfSaleInformationObj.Emv = emvObj; requestObj.PointOfSaleInformation = v2PaymentsPointOfSaleInformationObj; var v2PaymentsOrderInformationObj = new V2paymentsOrderInformation(); var v2PaymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo { Country = "US", LastName = "Deo", Address1 = "201 S. Division St.", PostalCode = "48104-2201", Locality = "Ann Arbor", AdministrativeArea = "MI", FirstName = "John", PhoneNumber = "999999999", Email = "*****@*****.**" }; v2PaymentsOrderInformationObj.BillTo = v2PaymentsOrderInformationBillToObj; var amountDetailsObj = new V2paymentsOrderInformationAmountDetails { TotalAmount = "100.00", Currency = "usd" }; v2PaymentsOrderInformationObj.AmountDetails = amountDetailsObj; requestObj.OrderInformation = v2PaymentsOrderInformationObj; var v2PaymentsPaymentInformationObj = new V2paymentsPaymentInformation(); var v2PaymentsPaymentInformationCardObj = new V2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "372425119311008", SecurityCode = "123", ExpirationMonth = "12" }; v2PaymentsPaymentInformationObj.Card = v2PaymentsPaymentInformationCardObj; var v2PaymentsPaymentInformationFluidDataObj = new V2paymentsPaymentInformationFluidData { Value = "%B373235387881007^SMITH/JOHN ^31121019761100 00868000000?;373235387881007=31121019761186800000?" }; v2PaymentsPaymentInformationObj.FluidData = v2PaymentsPaymentInformationFluidDataObj; requestObj.PaymentInformation = v2PaymentsPaymentInformationObj; var merchantConfig = new MerchantConfig(configDictionary) { RequestType = "POST", RequestTarget = "/pts/v2/payments", RequestJsonData = JsonConvert.SerializeObject(requestObj) }; try { var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig); var apiInstance = new PaymentApi(configurationSwagger); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); } }