public static PtsV2PaymentsCapturesPost201Response Run() { var processPaymentId = RestaurantAuthorization.Run().Id; string clientReferenceInformationCode = "1234567890"; string clientReferenceInformationPartnerThirdPartyCertificationNumber = "123456789012"; Ptsv2paymentsClientReferenceInformationPartner clientReferenceInformationPartner = new Ptsv2paymentsClientReferenceInformationPartner( ThirdPartyCertificationNumber: clientReferenceInformationPartnerThirdPartyCertificationNumber ); Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode, Partner: clientReferenceInformationPartner ); string processingInformationIndustryDataType = "restaurant"; Ptsv2paymentsidcapturesProcessingInformation processingInformation = new Ptsv2paymentsidcapturesProcessingInformation( IndustryDataType: processingInformationIndustryDataType ); string orderInformationAmountDetailsTotalAmount = "100"; string orderInformationAmountDetailsCurrency = "USD"; string orderInformationAmountDetailsGratuityAmount = "11.50"; Ptsv2paymentsidcapturesOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsidcapturesOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency, GratuityAmount: orderInformationAmountDetailsGratuityAmount ); Ptsv2paymentsidcapturesOrderInformation orderInformation = new Ptsv2paymentsidcapturesOrderInformation( AmountDetails: orderInformationAmountDetails ); var requestObj = new CapturePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, OrderInformation: orderInformation ); try { var configDictionary = new Configuration().GetConfiguration(); var clientConfig = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary); var apiInstance = new CaptureApi(clientConfig); PtsV2PaymentsCapturesPost201Response result = apiInstance.CapturePayment(requestObj, processPaymentId); 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"; string clientReferenceInformationPartnerOriginalTransactionId = "510be4aef90711e6acbc7d88388d803d"; Ptsv2paymentsClientReferenceInformationPartner clientReferenceInformationPartner = new Ptsv2paymentsClientReferenceInformationPartner( OriginalTransactionId: clientReferenceInformationPartnerOriginalTransactionId ); Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode, Partner: clientReferenceInformationPartner ); bool processingInformationCapture = false; string processingInformationCommerceIndicator = "retail"; Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator ); string orderInformationAmountDetailsTotalAmount = "100.00"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails ); int pointOfSaleInformationCatLevel = 1; string pointOfSaleInformationEntryMode = "contact"; int pointOfSaleInformationTerminalCapability = 4; string pointOfSaleInformationEmvTags = "9F3303204000950500000000009F3704518823719F100706011103A000009F26081E1756ED0E2134E29F36020015820200009C01009F1A0208409A030006219F02060000000020005F2A0208409F0306000000000000"; int pointOfSaleInformationEmvCardholderVerificationMethodUsed = 2; string pointOfSaleInformationEmvCardSequenceNumber = "1"; bool pointOfSaleInformationEmvFallback = false; Ptsv2paymentsPointOfSaleInformationEmv pointOfSaleInformationEmv = new Ptsv2paymentsPointOfSaleInformationEmv( Tags: pointOfSaleInformationEmvTags, CardholderVerificationMethodUsed: pointOfSaleInformationEmvCardholderVerificationMethodUsed, CardSequenceNumber: pointOfSaleInformationEmvCardSequenceNumber, Fallback: pointOfSaleInformationEmvFallback ); string pointOfSaleInformationTrackData = "%B4111111111111111^TEST/CYBS ^2012121019761100 00868000000?;"; List <string> pointOfSaleInformationCardholderVerificationMethod = new List <string>(); pointOfSaleInformationCardholderVerificationMethod.Add("pin"); pointOfSaleInformationCardholderVerificationMethod.Add("signature"); List <string> pointOfSaleInformationTerminalInputCapability = new List <string>(); pointOfSaleInformationTerminalInputCapability.Add("contact"); pointOfSaleInformationTerminalInputCapability.Add("contactless"); pointOfSaleInformationTerminalInputCapability.Add("keyed"); pointOfSaleInformationTerminalInputCapability.Add("swiped"); string pointOfSaleInformationTerminalCardCaptureCapability = "1"; string pointOfSaleInformationDeviceId = "123lkjdIOBK34981slviLI39bj"; string pointOfSaleInformationEncryptedKeySerialNumber = "01043191"; Ptsv2paymentsPointOfSaleInformation pointOfSaleInformation = new Ptsv2paymentsPointOfSaleInformation( CatLevel: pointOfSaleInformationCatLevel, EntryMode: pointOfSaleInformationEntryMode, TerminalCapability: pointOfSaleInformationTerminalCapability, Emv: pointOfSaleInformationEmv, TrackData: pointOfSaleInformationTrackData, CardholderVerificationMethod: pointOfSaleInformationCardholderVerificationMethod, TerminalInputCapability: pointOfSaleInformationTerminalInputCapability, TerminalCardCaptureCapability: pointOfSaleInformationTerminalCardCaptureCapability, DeviceId: pointOfSaleInformationDeviceId, EncryptedKeySerialNumber: pointOfSaleInformationEncryptedKeySerialNumber ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, 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 = "123456"; string clientReferenceInformationPartnerThirdPartyCertificationNumber = "123456789012"; Ptsv2paymentsClientReferenceInformationPartner clientReferenceInformationPartner = new Ptsv2paymentsClientReferenceInformationPartner( ThirdPartyCertificationNumber: clientReferenceInformationPartnerThirdPartyCertificationNumber ); Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode, Partner: clientReferenceInformationPartner ); bool processingInformationCapture = true; 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 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 = "demomerchant"; string clientReferenceInformationPartnerThirdPartyCertificationNumber = "123456789012"; Ptsv2paymentsClientReferenceInformationPartner clientReferenceInformationPartner = new Ptsv2paymentsClientReferenceInformationPartner( ThirdPartyCertificationNumber: clientReferenceInformationPartnerThirdPartyCertificationNumber ); Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation( Code: clientReferenceInformationCode, Partner: clientReferenceInformationPartner ); bool processingInformationCapture = false; string processingInformationCommerceIndicator = "retail"; bool processingInformationAuthorizationOptionsPartialAuthIndicator = true; bool processingInformationAuthorizationOptionsIgnoreAvsResult = false; bool processingInformationAuthorizationOptionsIgnoreCvResult = false; Ptsv2paymentsProcessingInformationAuthorizationOptions processingInformationAuthorizationOptions = new Ptsv2paymentsProcessingInformationAuthorizationOptions( PartialAuthIndicator: processingInformationAuthorizationOptionsPartialAuthIndicator, IgnoreAvsResult: processingInformationAuthorizationOptionsIgnoreAvsResult, IgnoreCvResult: processingInformationAuthorizationOptionsIgnoreCvResult ); Ptsv2paymentsProcessingInformation processingInformation = new Ptsv2paymentsProcessingInformation( Capture: processingInformationCapture, CommerceIndicator: processingInformationCommerceIndicator, AuthorizationOptions: processingInformationAuthorizationOptions ); string orderInformationAmountDetailsTotalAmount = "100.00"; string orderInformationAmountDetailsCurrency = "USD"; Ptsv2paymentsOrderInformationAmountDetails orderInformationAmountDetails = new Ptsv2paymentsOrderInformationAmountDetails( TotalAmount: orderInformationAmountDetailsTotalAmount, Currency: orderInformationAmountDetailsCurrency ); Ptsv2paymentsOrderInformation orderInformation = new Ptsv2paymentsOrderInformation( AmountDetails: orderInformationAmountDetails ); string pointOfSaleInformationEntryMode = "swiped"; int pointOfSaleInformationTerminalCapability = 2; string pointOfSaleInformationTrackData = "%B38000000000006^TEST/CYBS ^2012121019761100 00868000000?"; Ptsv2paymentsPointOfSaleInformation pointOfSaleInformation = new Ptsv2paymentsPointOfSaleInformation( EntryMode: pointOfSaleInformationEntryMode, TerminalCapability: pointOfSaleInformationTerminalCapability, TrackData: pointOfSaleInformationTrackData ); var requestObj = new CreatePaymentRequest( ClientReferenceInformation: clientReferenceInformation, ProcessingInformation: processingInformation, 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); } }