Esempio n. 1
0
        public static PtsV2PaymentsVoidsPost201Response Run()
        {
            var    id = CapturePayment.Run().Id;
            string clientReferenceInformationCode = "test_void";
            Ptsv2paymentsidreversalsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsidreversalsClientReferenceInformation(
                Code: clientReferenceInformationCode
                );

            var requestObj = new VoidCaptureRequest(
                ClientReferenceInformation: clientReferenceInformation
                );

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

                var apiInstance = new VoidApi(clientConfig);
                PtsV2PaymentsVoidsPost201Response result = apiInstance.VoidCapture(requestObj, id);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Esempio n. 2
0
        public static PtsV2PaymentsVoidsPost201Response Run()
        {
            AuthorizationCaptureForTimeoutVoidFlow.Run();
            string clientReferenceInformationTransactionId = SampleCode.TimeoutVoidTransactionId;
            Ptsv2paymentsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsClientReferenceInformation(
                TransactionId: clientReferenceInformationTransactionId
                );

            var requestObj = new MitVoidRequest(
                ClientReferenceInformation: clientReferenceInformation
                );

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

                var apiInstance = new VoidApi(clientConfig);
                PtsV2PaymentsVoidsPost201Response result = apiInstance.MitVoid(requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
Esempio n. 3
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var merchantConfig = new MerchantConfig(configDictionary)
            {
                RequestType   = "GET",
                RequestTarget = "/pts/v2/voids/5335528892726038303523"
            };

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new VoidApi(configurationSwagger);
                var result = apiInstance.GetVoid("5335528892726038303523");
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Esempio n. 4
0
        public static void Run()
        {
            var capturePaymentId = CapturePayment.Run().Id;
            var clientReferenceInformationObj = new Ptsv2paymentsidreversalsClientReferenceInformation("test_capture_void");
            var requestBody = new VoidCaptureRequest(clientReferenceInformationObj);

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

                var result = apiInstance.VoidCapture(requestBody, capturePaymentId);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
        public static void Run()
        {
            var eCheckStandaloneCreditWithServiceFeeId = ECheckStandaloneCreditWithServiceFee.Run().Id;

            var clientReferenceInformationObj = new Ptsv2paymentsidreversalsClientReferenceInformation("test_credit_void");
            var requestBody = new VoidCreditRequest(clientReferenceInformationObj);

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

                var result = apiInstance.VoidCredit(requestBody, eCheckStandaloneCreditWithServiceFeeId);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Esempio n. 6
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var clientReferenceInformationObj = new V2paymentsidreversalsClientReferenceInformation("test_void");
            var requestObj = new VoidPaymentRequest(clientReferenceInformationObj);

            var merchantConfig = new MerchantConfig(configDictionary)
            {
                RequestType     = "POST",
                RequestTarget   = "/pts/v2/payments/5335461889256917903529/voids",
                RequestJsonData = JsonConvert.SerializeObject(requestObj)
            };

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new VoidApi(configurationSwagger);
                var result = apiInstance.VoidPayment(requestObj, "5335461889256917903529");
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Esempio n. 7
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var requestObj = new VoidPaymentRequest();

            var v2PaymentsClientReferenceInformationObj = new V2paymentsidreversalsClientReferenceInformation
            {
                Code = "1234567890"
            };

            requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj;

            /*
             * var v2paymentsPointOfSaleInformationObj = new V2paymentsPointOfSaleInformation();
             *
             * v2paymentsPointOfSaleInformationObj.CardPresent = "false";
             * v2paymentsPointOfSaleInformationObj.CatLevel = "6";
             * v2paymentsPointOfSaleInformationObj.TerminalCapability = "4";
             * requestObj.PointOfSaleInformation = v2paymentsPointOfSaleInformationObj;
             *
             * var v2paymentsOrderInformationObj = new V2paymentsOrderInformation();
             *
             * var v2paymentsOrderInformationBillToObj = new V2paymentsOrderInformationBillTo();
             *
             * v2paymentsOrderInformationBillToObj.Country = "US";
             * v2paymentsOrderInformationBillToObj.FirstName = "John";
             * v2paymentsOrderInformationBillToObj.LastName = "Deo";
             * v2paymentsOrderInformationBillToObj.Address1 = "901 Metro Center Blvd";
             * v2paymentsOrderInformationBillToObj.PostalCode = "40500";
             * v2paymentsOrderInformationBillToObj.Locality = "Foster City";
             * v2paymentsOrderInformationBillToObj.AdministrativeArea = "CA";
             * v2paymentsOrderInformationBillToObj.Email = "*****@*****.**";
             * v2paymentsOrderInformationObj.BillTo = v2paymentsOrderInformationBillToObj;
             *
             * var v2paymentsOrderInformationAmountDetailsObj = new V2paymentsOrderInformationAmountDetails();
             *
             * v2paymentsOrderInformationAmountDetailsObj.TotalAmount = "100";
             * v2paymentsOrderInformationAmountDetailsObj.Currency = "USD";
             * v2paymentsOrderInformationObj.AmountDetails = v2paymentsOrderInformationAmountDetailsObj;
             *
             * requestObj.OrderInformation = v2paymentsOrderInformationObj;
             */

            var merchantConfig = new MerchantConfig(configDictionary)
            {
                RequestType     = "POST",
                RequestTarget   = "/pts/v2/payments/5335461889256917903529/voids",
                RequestJsonData = JsonConvert.SerializeObject(requestObj)
            };

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new VoidApi(configurationSwagger);
                var result = apiInstance.VoidPayment(requestObj, "5335461889256917903529");
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Esempio n. 8
0
 public void Init()
 {
     instance = new VoidApi();
 }