public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "TC50171_3"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); List <string> processingInformationActionList = new List <string>(); processingInformationActionList.Add("TOKEN_CREATE"); List <string> processingInformationActionTokenTypes = new List <string>(); processingInformationActionTokenTypes.Add("instrumentIdentifier"); bool processingInformationCapture = false; string processingInformationCommerceIndicator = "internet"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( ActionList: processingInformationActionList, ActionTokenTypes: processingInformationActionTokenTypes, Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, SecurityCode: paymentInformationCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "102.21"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Doe"; string orderInformationBillToAddress1 = "1 Market St"; string orderInformationBillToLocality = "san francisco"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94105"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "4158880000"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); string orderInformationShipToFirstName = "John"; string orderInformationShipToLastName = "Doe"; string orderInformationShipToAddress1 = "1 Market St"; string orderInformationShipToLocality = "san francisco"; string orderInformationShipToAdministrativeArea = "CA"; string orderInformationShipToPostalCode = "94105"; string orderInformationShipToCountry = "US"; Ptsv2paymentsOrderInformationShipTo orderInformationShipTo = new Ptsv2paymentsOrderInformationShipTo( FirstName: orderInformationShipToFirstName, LastName: orderInformationShipToLastName, Address1: orderInformationShipToAddress1, Locality: orderInformationShipToLocality, AdministrativeArea: orderInformationShipToAdministrativeArea, PostalCode: orderInformationShipToPostalCode, Country: orderInformationShipToCountry ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo, ShipTo: orderInformationShipTo ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "123456"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); bool processingInformationCapture = true; string processingInformationCommerceIndicator = "retail"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, SecurityCode: paymentInformationCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "100.00"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails ); string pointOfSaleInformationEntryMode = "keyed"; int pointOfSaleInformationTerminalCapability = 2; Ptsv2paymentsPointOfSaleInformation pointOfSaleInformation = new Ptsv2paymentsPointOfSaleInformation( EntryMode: pointOfSaleInformationEntryMode, TerminalCapability: pointOfSaleInformationTerminalCapability ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, PointOfSaleInformation: pointOfSaleInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "54323007"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); string paymentInformationCardNumber = "4444444444444448"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2020"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "144.14"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "James"; string orderInformationBillToLastName = "Smith"; string orderInformationBillToAddress1 = "96, powers street"; string orderInformationBillToLocality = "Clearwater milford"; string orderInformationBillToAdministrativeArea = "NH"; string orderInformationBillToPostalCode = "03055"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "7606160717"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); string deviceInformationHostName = "host.com"; string deviceInformationIpAddress = "64.124.61.215"; string deviceInformationUserAgent = "Chrome"; string deviceInformationHttpBrowserEmail = "*****@*****.**"; Ptsv2paymentsDeviceInformation deviceInformation = new Ptsv2paymentsDeviceInformation( HostName: deviceInformationHostName, IpAddress: deviceInformationIpAddress, UserAgent: deviceInformationUserAgent, HttpBrowserEmail: deviceInformationHttpBrowserEmail ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, DeviceInformation: deviceInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "1234567890"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, SecurityCode: paymentInformationCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "7012.00"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Doe"; string orderInformationBillToAddress1 = "1 Market St"; string orderInformationBillToLocality = "san francisco"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94105"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "4158880000"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); int pointOfSaleInformationCatLevel = 6; int pointOfSaleInformationTerminalCapability = 4; bool pointOfSaleInformationEmvFallback = false; int pointOfSaleInformationEmvFallbackCondition = 1; Ptsv2paymentsPointOfSaleInformationEmv pointOfSaleInformationEmv = new Ptsv2paymentsPointOfSaleInformationEmv( Fallback: pointOfSaleInformationEmvFallback, FallbackCondition: pointOfSaleInformationEmvFallbackCondition ); Ptsv2paymentsPointOfSaleInformation pointOfSaleInformation = new Ptsv2paymentsPointOfSaleInformation( CatLevel: pointOfSaleInformationCatLevel, TerminalCapability: pointOfSaleInformationTerminalCapability, Emv: pointOfSaleInformationEmv ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, PointOfSaleInformation: pointOfSaleInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "TC50171_3"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); bool processingInformationCapture = false; if (CaptureTrueForProcessPayment) { processingInformationCapture = true; } Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, SecurityCode: paymentInformationCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "2325.00"; string orderInformationAmountDetailsCurrency = "USD"; string orderInformationAmountDetailsServiceFeeAmount = "30.0"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency, ServiceFeeAmount: orderInformationAmountDetailsServiceFeeAmount ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Doe"; string orderInformationBillToAddress1 = "1 Market St"; string orderInformationBillToLocality = "san francisco"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94105"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "4158880000"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); string merchantInformationServiceFeeDescriptorName = "Vacations Service Fee"; string merchantInformationServiceFeeDescriptorContact = "8009999999"; string merchantInformationServiceFeeDescriptorState = "CA"; Ptsv2paymentsMerchantInformationServiceFeeDescriptor merchantInformationServiceFeeDescriptor = new Ptsv2paymentsMerchantInformationServiceFeeDescriptor( Name: merchantInformationServiceFeeDescriptorName, Contact: merchantInformationServiceFeeDescriptorContact, State: merchantInformationServiceFeeDescriptorState ); Ptsv2paymentsMerchantInformation merchantInformation = new Ptsv2paymentsMerchantInformation( ServiceFeeDescriptor: merchantInformationServiceFeeDescriptor ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, MerchantInformation: merchantInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { var processingInformationObj = new Ptsv2paymentsProcessingInformation() { CommerceIndicator = "internet" }; var clientReferenceInformationObj = new Ptsv2paymentsClientReferenceInformation { Code = "test_payment" }; var pointOfSaleInformationObj = new Ptsv2paymentsPointOfSaleInformation { CatLevel = 6, TerminalCapability = 4 }; var orderInformationObj = new Ptsv2paymentsOrderInformation(); var billToObj = new Ptsv2paymentsOrderInformationBillTo { Country = "US", FirstName = "John", LastName = "Doe", Address1 = "1 Market St", PostalCode = "94105", Locality = "San Francisco", AdministrativeArea = "CA", Email = "*****@*****.**" }; orderInformationObj.BillTo = billToObj; var amountDetailsObj = new Ptsv2paymentsOrderInformationAmountDetails { TotalAmount = "102.21", Currency = "USD" }; orderInformationObj.AmountDetails = amountDetailsObj; var paymentInformationObj = new Ptsv2paymentsPaymentInformation(); var cardObj = new Ptsv2paymentsPaymentInformationCard { ExpirationYear = "2031", Number = "4111111111111111", SecurityCode = "123", ExpirationMonth = "12" }; paymentInformationObj.Card = cardObj; var requestObj = new CreatePaymentRequest { ProcessingInformation = processingInformationObj, PaymentInformation = paymentInformationObj, ClientReferenceInformation = clientReferenceInformationObj, PointOfSaleInformation = pointOfSaleInformationObj, OrderInformation = orderInformationObj }; if (CaptureTrueForProcessPayment) { requestObj.ProcessingInformation.Capture = true; } try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); var result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API: " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "TSYS_Eh_FE_01"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "11"; string paymentInformationCardExpirationYear = "2025"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "10"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "JSON"; string orderInformationBillToLastName = "RTS"; string orderInformationBillToAddress1 = "201 S. Division St._1"; string orderInformationBillToLocality = "Foster City"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94404"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "6504327113"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "TC50171_14"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); bool processingInformationCapture = false; if (CaptureTrueForProcessPayment) { processingInformationCapture = true; } string processingInformationPurchaseLevel = "3"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, PurchaseLevel: processingInformationPurchaseLevel ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardType = "001"; string paymentInformationCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, Type: paymentInformationCardType, SecurityCode: paymentInformationCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "100.00"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Doe"; string orderInformationBillToAddress1 = "1 Market St"; string orderInformationBillToLocality = "san francisco"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94105"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "4158880000"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); List <Ptsv2paymentsOrderInformationLineItems> orderInformationLineItems = new List <Ptsv2paymentsOrderInformationLineItems>(); string orderInformationLineItemsProductCode1 = "default"; int orderInformationLineItemsQuantity1 = 10; string orderInformationLineItemsUnitPrice1 = "10.00"; string orderInformationLineItemsTotalAmount1 = "100"; bool orderInformationLineItemsAmountIncludesTax1 = false; bool orderInformationLineItemsDiscountApplied1 = false; orderInformationLineItems.Add(new Ptsv2paymentsOrderInformationLineItems( ProductCode: orderInformationLineItemsProductCode1, Quantity: orderInformationLineItemsQuantity1, UnitPrice: orderInformationLineItemsUnitPrice1, TotalAmount: orderInformationLineItemsTotalAmount1, AmountIncludesTax: orderInformationLineItemsAmountIncludesTax1, DiscountApplied: orderInformationLineItemsDiscountApplied1 )); string orderInformationInvoiceDetailsPurchaseOrderNumber = "LevelIII Auth Po"; Ptsv2paymentsOrderInformationInvoiceDetails orderInformationInvoiceDetails = new Ptsv2paymentsOrderInformationInvoiceDetails( PurchaseOrderNumber: orderInformationInvoiceDetailsPurchaseOrderNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo, LineItems: orderInformationLineItems, InvoiceDetails: orderInformationInvoiceDetails ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { bool processingInformationCapture = false; string processingInformationIndustryDataType = "lodging"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, IndustryDataType: processingInformationIndustryDataType ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2021"; string paymentInformationCardType = "001"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, Type: paymentInformationCardType ); string paymentInformationTokenizedCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationTokenizedCard paymentInformationTokenizedCard = new Ptsv2paymentsPaymentInformationTokenizedCard( SecurityCode: paymentInformationTokenizedCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard, TokenizedCard: paymentInformationTokenizedCard ); string orderInformationAmountDetailsTotalAmount = "20"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Smith"; string orderInformationBillToAddress1 = "201 S. Division St."; string orderInformationBillToAddress2 = "Suite 500"; string orderInformationBillToLocality = "Ann Arbor"; string orderInformationBillToAdministrativeArea = "MI"; string orderInformationBillToPostalCode = "12345"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "514-670-8700"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Address2: orderInformationBillToAddress2, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); string orderInformationShipToFirstName = "Olivia"; string orderInformationShipToLastName = "White"; string orderInformationShipToAddress1 = "1295 Charleston Rd"; string orderInformationShipToAddress2 = "Cube 2386"; string orderInformationShipToLocality = "Mountain View"; string orderInformationShipToAdministrativeArea = "CA"; string orderInformationShipToPostalCode = "94041"; string orderInformationShipToCountry = "AE"; string orderInformationShipToPhoneNumber = "650-965-6000"; Ptsv2paymentsOrderInformationShipTo orderInformationShipTo = new Ptsv2paymentsOrderInformationShipTo( FirstName: orderInformationShipToFirstName, LastName: orderInformationShipToLastName, Address1: orderInformationShipToAddress1, Address2: orderInformationShipToAddress2, Locality: orderInformationShipToLocality, AdministrativeArea: orderInformationShipToAdministrativeArea, PostalCode: orderInformationShipToPostalCode, Country: orderInformationShipToCountry, PhoneNumber: orderInformationShipToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo, ShipTo: orderInformationShipTo ); string merchantInformationMerchantDescriptorContact = "965-6000"; Ptsv2paymentsMerchantInformationMerchantDescriptor merchantInformationMerchantDescriptor = new Ptsv2paymentsMerchantInformationMerchantDescriptor( Contact: merchantInformationMerchantDescriptorContact ); Ptsv2paymentsMerchantInformation merchantInformation = new Ptsv2paymentsMerchantInformation( MerchantDescriptor: merchantInformationMerchantDescriptor ); string consumerAuthenticationInformationCavv = "ABCDEabcde12345678900987654321abcdeABCDE"; string consumerAuthenticationInformationXid = "12345678909876543210ABCDEabcdeABCDEF1234"; Ptsv2paymentsConsumerAuthenticationInformation consumerAuthenticationInformation = new Ptsv2paymentsConsumerAuthenticationInformation( Cavv: consumerAuthenticationInformationCavv, Xid: consumerAuthenticationInformationXid ); string installmentInformationAmount = "1200"; string installmentInformationFrequency = "W"; int installmentInformationSequence = 34; string installmentInformationTotalAmount = "2000"; int installmentInformationTotalCount = 12; Ptsv2paymentsInstallmentInformation installmentInformation = new Ptsv2paymentsInstallmentInformation( Amount: installmentInformationAmount, Frequency: installmentInformationFrequency, Sequence: installmentInformationSequence, TotalAmount: installmentInformationTotalAmount, TotalCount: installmentInformationTotalCount ); string travelInformationDuration = "3"; string travelInformationLodgingCheckInDate = "11062019"; string travelInformationLodgingCheckOutDate = "11092019"; List <Ptsv2paymentsTravelInformationLodgingRoom> travelInformationLodgingRoom = new List <Ptsv2paymentsTravelInformationLodgingRoom>(); string travelInformationLodgingRoomDailyRate1 = "1.50"; int travelInformationLodgingRoomNumberOfNights1 = 5; travelInformationLodgingRoom.Add(new Ptsv2paymentsTravelInformationLodgingRoom( DailyRate: travelInformationLodgingRoomDailyRate1, NumberOfNights: travelInformationLodgingRoomNumberOfNights1 )); string travelInformationLodgingRoomDailyRate2 = "11.50"; int travelInformationLodgingRoomNumberOfNights2 = 5; travelInformationLodgingRoom.Add(new Ptsv2paymentsTravelInformationLodgingRoom( DailyRate: travelInformationLodgingRoomDailyRate2, NumberOfNights: travelInformationLodgingRoomNumberOfNights2 )); string travelInformationLodgingSmokingPreference = "yes"; int travelInformationLodgingNumberOfRooms = 1; int travelInformationLodgingNumberOfGuests = 3; string travelInformationLodgingRoomBedType = "king"; string travelInformationLodgingRoomTaxType = "tourist"; string travelInformationLodgingRoomRateType = "sr citizen"; string travelInformationLodgingGuestName = "Tulasi"; string travelInformationLodgingCustomerServicePhoneNumber = "+13304026334"; string travelInformationLodgingCorporateClientCode = "HDGGASJDGSUY"; string travelInformationLodgingAdditionalDiscountAmount = "99.123456781"; string travelInformationLodgingRoomLocation = "seaview"; string travelInformationLodgingSpecialProgramCode = "2"; string travelInformationLodgingTotalTaxAmount = "99.1234567891"; string travelInformationLodgingPrepaidCost = "9999999999.99"; string travelInformationLodgingFoodAndBeverageCost = "9999999999.99"; string travelInformationLodgingRoomTaxAmount = "9999999999.99"; string travelInformationLodgingAdjustmentAmount = "9999999999.99"; string travelInformationLodgingPhoneCost = "9999999999.99"; string travelInformationLodgingRestaurantCost = "9999999999.99"; string travelInformationLodgingRoomServiceCost = "9999999999.99"; string travelInformationLodgingMiniBarCost = "9999999999.99"; string travelInformationLodgingLaundryCost = "9999999999.99"; string travelInformationLodgingMiscellaneousCost = "9999999999.99"; string travelInformationLodgingGiftShopCost = "9999999999.99"; string travelInformationLodgingMovieCost = "9999999999.99"; string travelInformationLodgingHealthClubCost = "9999999999.99"; string travelInformationLodgingValetParkingCost = "9999999999.99"; string travelInformationLodgingCashDisbursementCost = "9999999999.99"; string travelInformationLodgingNonRoomCost = "9999999999.99"; string travelInformationLodgingBusinessCenterCost = "9999999999.99"; string travelInformationLodgingLoungeBarCost = "9999999999.99"; string travelInformationLodgingTransportationCost = "9999999999.99"; string travelInformationLodgingGratuityAmount = "9999999999.99"; string travelInformationLodgingConferenceRoomCost = "9999999999.99"; string travelInformationLodgingAudioVisualCost = "9999999999.99"; string travelInformationLodgingNonRoomTaxAmount = "9999999999.99"; string travelInformationLodgingEarlyCheckOutCost = "9999999999.99"; string travelInformationLodgingInternetAccessCost = "9999999999.99"; Ptsv2paymentsTravelInformationLodging travelInformationLodging = new Ptsv2paymentsTravelInformationLodging( CheckInDate: travelInformationLodgingCheckInDate, CheckOutDate: travelInformationLodgingCheckOutDate, Room: travelInformationLodgingRoom, SmokingPreference: travelInformationLodgingSmokingPreference, NumberOfRooms: travelInformationLodgingNumberOfRooms, NumberOfGuests: travelInformationLodgingNumberOfGuests, RoomBedType: travelInformationLodgingRoomBedType, RoomTaxType: travelInformationLodgingRoomTaxType, RoomRateType: travelInformationLodgingRoomRateType, GuestName: travelInformationLodgingGuestName, CustomerServicePhoneNumber: travelInformationLodgingCustomerServicePhoneNumber, CorporateClientCode: travelInformationLodgingCorporateClientCode, AdditionalDiscountAmount: travelInformationLodgingAdditionalDiscountAmount, RoomLocation: travelInformationLodgingRoomLocation, SpecialProgramCode: travelInformationLodgingSpecialProgramCode, TotalTaxAmount: travelInformationLodgingTotalTaxAmount, PrepaidCost: travelInformationLodgingPrepaidCost, FoodAndBeverageCost: travelInformationLodgingFoodAndBeverageCost, RoomTaxAmount: travelInformationLodgingRoomTaxAmount, AdjustmentAmount: travelInformationLodgingAdjustmentAmount, PhoneCost: travelInformationLodgingPhoneCost, RestaurantCost: travelInformationLodgingRestaurantCost, RoomServiceCost: travelInformationLodgingRoomServiceCost, MiniBarCost: travelInformationLodgingMiniBarCost, LaundryCost: travelInformationLodgingLaundryCost, MiscellaneousCost: travelInformationLodgingMiscellaneousCost, GiftShopCost: travelInformationLodgingGiftShopCost, MovieCost: travelInformationLodgingMovieCost, HealthClubCost: travelInformationLodgingHealthClubCost, ValetParkingCost: travelInformationLodgingValetParkingCost, CashDisbursementCost: travelInformationLodgingCashDisbursementCost, NonRoomCost: travelInformationLodgingNonRoomCost, BusinessCenterCost: travelInformationLodgingBusinessCenterCost, LoungeBarCost: travelInformationLodgingLoungeBarCost, TransportationCost: travelInformationLodgingTransportationCost, GratuityAmount: travelInformationLodgingGratuityAmount, ConferenceRoomCost: travelInformationLodgingConferenceRoomCost, AudioVisualCost: travelInformationLodgingAudioVisualCost, NonRoomTaxAmount: travelInformationLodgingNonRoomTaxAmount, EarlyCheckOutCost: travelInformationLodgingEarlyCheckOutCost, InternetAccessCost: travelInformationLodgingInternetAccessCost ); Ptsv2paymentsTravelInformation travelInformation = new Ptsv2paymentsTravelInformation( Duration: travelInformationDuration, Lodging: travelInformationLodging ); string promotionInformationAdditionalCode = "9999999999.99"; Ptsv2paymentsPromotionInformation promotionInformation = new Ptsv2paymentsPromotionInformation( AdditionalCode: promotionInformationAdditionalCode ); var requestObj = new CreatePaymentRequest( ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, MerchantInformation: merchantInformation, ConsumerAuthenticationInformation: consumerAuthenticationInformation, InstallmentInformation: installmentInformation, TravelInformation: travelInformation, PromotionInformation: promotionInformation ); try { var configDictionary = new Configuration().GetAlternativeConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "demomerchant"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); bool processingInformationCapture = false; string processingInformationCommerceIndicator = "retail"; bool processingInformationAuthorizationOptionsPartialAuthIndicator = true; bool processingInformationAuthorizationOptionsIgnoreAvsResult = true; bool processingInformationAuthorizationOptionsIgnoreCvResult = true; Ptsv2paymentsProcessingInformationAuthorizationOptions processingInformationAuthorizationOptions = new Ptsv2paymentsProcessingInformationAuthorizationOptions( PartialAuthIndicator: processingInformationAuthorizationOptionsPartialAuthIndicator, IgnoreAvsResult: processingInformationAuthorizationOptionsIgnoreAvsResult, IgnoreCvResult: processingInformationAuthorizationOptionsIgnoreCvResult ); Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator, AuthorizationOptions: processingInformationAuthorizationOptions ); string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2050"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear ); string paymentInformationFluidDataDescriptor = "Ymx1ZWZpbg=="; string paymentInformationFluidDataValue = "02d700801f3c20008383252a363031312a2a2a2a2a2a2a2a303030395e46444d53202020202020202020202020202020202020202020205e323231322a2a2a2a2a2a2a2a3f2a3b363031312a2a2a2a2a2a2a2a303030393d323231322a2a2a2a2a2a2a2a3f2a7a75ad15d25217290c54b3d9d1c3868602136c68d339d52d98423391f3e631511d548fff08b414feac9ff6c6dede8fb09bae870e4e32f6f462d6a75fa0a178c3bd18d0d3ade21bc7a0ea687a2eef64551751e502d97cb98dc53ea55162cdfa395431323439323830303762994901000001a000731a8003"; Ptsv2paymentsPaymentInformationFluidData paymentInformationFluidData = new Ptsv2paymentsPaymentInformationFluidData( Descriptor: paymentInformationFluidDataDescriptor, Value: paymentInformationFluidDataValue ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard, FluidData: paymentInformationFluidData ); string orderInformationAmountDetailsTotalAmount = "100.00"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Deo"; string orderInformationBillToAddress1 = "201 S. Division St."; string orderInformationBillToLocality = "Ann Arbor"; string orderInformationBillToAdministrativeArea = "MI"; string orderInformationBillToPostalCode = "48104-2201"; string orderInformationBillToCountry = "US"; string orderInformationBillToDistrict = "MI"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "999999999"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, District: orderInformationBillToDistrict, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); int pointOfSaleInformationCatLevel = 1; string pointOfSaleInformationEntryMode = "keyed"; int pointOfSaleInformationTerminalCapability = 2; Ptsv2paymentsPointOfSaleInformation pointOfSaleInformation = new Ptsv2paymentsPointOfSaleInformation( CatLevel: pointOfSaleInformationCatLevel, EntryMode: pointOfSaleInformationEntryMode, TerminalCapability: pointOfSaleInformationTerminalCapability ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, PointOfSaleInformation: pointOfSaleInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "TC50171_3"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); List <string> processingInformationActionList = new List <string>(); processingInformationActionList.Add("CONSUMER_AUTHENTICATION"); bool processingInformationCapture = false; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( ActionList: processingInformationActionList, Capture: processingInformationCapture ); string paymentInformationCardNumber = "4000000000001091"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2023"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "100.00"; string orderInformationAmountDetailsCurrency = "usd"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Smith"; string orderInformationBillToAddress1 = "201 S. Division St._1"; string orderInformationBillToAddress2 = "Suite 500"; string orderInformationBillToLocality = "Foster City"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94404"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "6504327113"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Address2: orderInformationBillToAddress2, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); string consumerAuthenticationInformationRequestorId = "123123197675"; string consumerAuthenticationInformationReferenceId = "CybsCruiseTester-8ac0b02f"; Ptsv2paymentsConsumerAuthenticationInformation consumerAuthenticationInformation = new Ptsv2paymentsConsumerAuthenticationInformation( RequestorId: consumerAuthenticationInformationRequestorId, ReferenceId: consumerAuthenticationInformationReferenceId ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation, ConsumerAuthenticationInformation: consumerAuthenticationInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "TC50171_3"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); bool processingInformationCapture = false; string processingInformationCommerceIndicator = "internet"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator ); string paymentInformationCardExpirationMonth = "03"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardType = "001"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, Type: paymentInformationCardType ); string paymentInformationInstrumentIdentifierId = "7010000000016241111"; Ptsv2paymentsPaymentInformationInstrumentIdentifier paymentInformationInstrumentIdentifier = new Ptsv2paymentsPaymentInformationInstrumentIdentifier( Id: paymentInformationInstrumentIdentifierId ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard, InstrumentIdentifier: paymentInformationInstrumentIdentifier ); string orderInformationAmountDetailsTotalAmount = "200"; string orderInformationAmountDetailsCurrency = "usd"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Deo"; string orderInformationBillToAddress1 = "900 Metro Center Blvd"; string orderInformationBillToLocality = "Foster City"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "48104-2201"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "9321499232"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { string clientReferenceInformationCode = "54323007"; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode ); string paymentInformationCardNumber = "4444444444444448"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2020"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "144.14"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "James"; string orderInformationBillToLastName = "Smith"; string orderInformationBillToAddress1 = "96, powers street"; string orderInformationBillToLocality = "Clearwater milford"; string orderInformationBillToAdministrativeArea = "NH"; string orderInformationBillToPostalCode = "03055"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "7606160717"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); string buyerInformationDateOfBirth = "19980505"; List <Ptsv2paymentsBuyerInformationPersonalIdentification> buyerInformationPersonalIdentification = new List <Ptsv2paymentsBuyerInformationPersonalIdentification>(); string buyerInformationPersonalIdentificationType1 = "CPF"; string buyerInformationPersonalIdentificationId1 = "1a23apwe98"; buyerInformationPersonalIdentification.Add(new Ptsv2paymentsBuyerInformationPersonalIdentification( Type: buyerInformationPersonalIdentificationType1, Id: buyerInformationPersonalIdentificationId1 )); string buyerInformationHashedPassword = ""; Ptsv2paymentsBuyerInformation buyerInformation = new Ptsv2paymentsBuyerInformation( DateOfBirth: buyerInformationDateOfBirth, PersonalIdentification: buyerInformationPersonalIdentification, HashedPassword: buyerInformationHashedPassword ); var requestObj = new CreatePaymentRequest( 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 PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }
public static PtsV2PaymentsPost201Response Run() { SampleCode.TimeoutReversalTransactionId = NumericUtility.LongRandom(1000, 1000000000 + 1); string clientReferenceInformationCode = "TC50171_3"; string clientReferenceInformationTransactionId = SampleCode.TimeoutReversalTransactionId; Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode, TransactionId: clientReferenceInformationTransactionId ); bool processingInformationCapture = false; if (CaptureTrueForProcessPayment) { processingInformationCapture = true; } string processingInformationCommerceIndicator = "internet"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator ); string paymentInformationCardNumber = "4111111111111111"; string paymentInformationCardExpirationMonth = "12"; string paymentInformationCardExpirationYear = "2031"; string paymentInformationCardSecurityCode = "123"; Ptsv2paymentsPaymentInformationCard paymentInformationCard = new Ptsv2paymentsPaymentInformationCard( Number: paymentInformationCardNumber, ExpirationMonth: paymentInformationCardExpirationMonth, ExpirationYear: paymentInformationCardExpirationYear, SecurityCode: paymentInformationCardSecurityCode ); Ptsv2paymentsPaymentInformation paymentInformation = new Ptsv2paymentsPaymentInformation( Card: paymentInformationCard ); string orderInformationAmountDetailsTotalAmount = "102.21"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); string orderInformationBillToFirstName = "John"; string orderInformationBillToLastName = "Doe"; string orderInformationBillToAddress1 = "1 Market St"; string orderInformationBillToAddress2 = "Address 2"; string orderInformationBillToLocality = "san francisco"; string orderInformationBillToAdministrativeArea = "CA"; string orderInformationBillToPostalCode = "94105"; string orderInformationBillToCountry = "US"; string orderInformationBillToEmail = "*****@*****.**"; string orderInformationBillToPhoneNumber = "4158880000"; Ptsv2paymentsOrderInformationBillTo orderInformationBillTo = new Ptsv2paymentsOrderInformationBillTo( FirstName: orderInformationBillToFirstName, LastName: orderInformationBillToLastName, Address1: orderInformationBillToAddress1, Address2: orderInformationBillToAddress2, Locality: orderInformationBillToLocality, AdministrativeArea: orderInformationBillToAdministrativeArea, PostalCode: orderInformationBillToPostalCode, Country: orderInformationBillToCountry, Email: orderInformationBillToEmail, PhoneNumber: orderInformationBillToPhoneNumber ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails, BillTo: orderInformationBillTo ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, PaymentInformation: paymentInformation, OrderInformation: orderInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new PaymentsApi(clientConfig); PtsV2PaymentsPost201Response result = apiInstance.CreatePayment(requestObj); Console.WriteLine(result); return(result); } catch (Exception e) { Console.WriteLine("Exception on calling the API : " + e.Message); return(null); } }