示例#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);
            }
        }
示例#2
0
        public static PtsV2PaymentsReversalsPost201Response Run()
        {
            var processPaymentId = ProcessPayment.Run().Id;

            var clientReferenceInformationObj = new Ptsv2paymentsidreversalsClientReferenceInformation("test_reversal");
            var amount           = new Ptsv2paymentsidreversalsOrderInformationLineItems(null, "102.21");
            var amountDetailsObj = new List <Ptsv2paymentsidreversalsOrderInformationLineItems> {
                amount
            };
            var orderInformationObj = new Ptsv2paymentsidreversalsOrderInformation(amountDetailsObj);
            var requestBody         = new AuthReversalRequest(clientReferenceInformationObj, null, null, orderInformationObj);

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

                var result = apiInstance.AuthReversal(processPaymentId, requestBody);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
                return(null);
            }
        }
示例#3
0
        public static PtsV2PaymentsReversalsPost201Response Run()
        {
            var processPaymentId = ProcessPaymentWithServiceFee.Run().Id;
            var requestBody      = new AuthReversalRequest();
            var clientReferenceInformationObj = new Ptsv2paymentsidreversalsClientReferenceInformation("TC50171_3");

            requestBody.ClientReferenceInformation = clientReferenceInformationObj;
            var v2paymentsidreversalsReversalInformationObj = new Ptsv2paymentsidreversalsReversalInformation
            {
                Reason = "34"
            };
            var v2paymentsidreversalsReversalInformationAmountDetailsobj = new Ptsv2paymentsidreversalsReversalInformationAmountDetails
            {
                TotalAmount = "2325.00"
            };

            v2paymentsidreversalsReversalInformationObj.AmountDetails = v2paymentsidreversalsReversalInformationAmountDetailsobj;
            requestBody.ReversalInformation = v2paymentsidreversalsReversalInformationObj;
            try
            {
                var configDictionary = new Configuration().GetConfiguration();
                var clientConfig     = new CyberSource.Client.Configuration(merchConfigDictObj: configDictionary);
                var apiInstance      = new ReversalApi(clientConfig);

                var result = apiInstance.AuthReversal(processPaymentId, requestBody);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
                return(null);
            }
        }
示例#4
0
        public static PtsV2PaymentsReversalsPost201Response Run()
        {
            SimpleAuthorizationInternet.CaptureTrueForProcessPayment = false;
            var id = SimpleAuthorizationInternet.Run().Id;

            string clientReferenceInformationCode = "TC50171_3";
            Ptsv2paymentsidreversalsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsidreversalsClientReferenceInformation(
                Code: clientReferenceInformationCode
                );

            string reversalInformationAmountDetailsTotalAmount = "102.21";
            Ptsv2paymentsidreversalsReversalInformationAmountDetails reversalInformationAmountDetails = new Ptsv2paymentsidreversalsReversalInformationAmountDetails(
                TotalAmount: reversalInformationAmountDetailsTotalAmount
                );

            string reversalInformationReason = "testing";
            Ptsv2paymentsidreversalsReversalInformation reversalInformation = new Ptsv2paymentsidreversalsReversalInformation(
                AmountDetails: reversalInformationAmountDetails,
                Reason: reversalInformationReason
                );

            var requestObj = new AuthReversalRequest(
                ClientReferenceInformation: clientReferenceInformation,
                ReversalInformation: reversalInformation
                );

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

                var apiInstance = new ReversalApi(clientConfig);
                PtsV2PaymentsReversalsPost201Response result = apiInstance.AuthReversal(id, requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
示例#5
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 PtsV2PaymentsReversalsPost201Response Run()
        {
            var id = ServiceFeesWithCreditCardTransaction.Run().Id;

            string clientReferenceInformationCode = "TC50171_3";
            Ptsv2paymentsidreversalsClientReferenceInformation clientReferenceInformation = new Ptsv2paymentsidreversalsClientReferenceInformation(
                Code: clientReferenceInformationCode
                );

            string reversalInformationAmountDetailsTotalAmount = "2325.00";
            Ptsv2paymentsidreversalsReversalInformationAmountDetails reversalInformationAmountDetails = new Ptsv2paymentsidreversalsReversalInformationAmountDetails(
                TotalAmount: reversalInformationAmountDetailsTotalAmount
                );

            string reversalInformationReason = "34";
            Ptsv2paymentsidreversalsReversalInformation reversalInformation = new Ptsv2paymentsidreversalsReversalInformation(
                AmountDetails: reversalInformationAmountDetails,
                Reason: reversalInformationReason
                );

            var requestObj = new AuthReversalRequest(
                ClientReferenceInformation: clientReferenceInformation,
                ReversalInformation: reversalInformation
                );

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

                var apiInstance = new ReversalApi(clientConfig);
                PtsV2PaymentsReversalsPost201Response result = apiInstance.AuthReversal(id, requestObj);
                Console.WriteLine(result);
                return(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API : " + e.Message);
                return(null);
            }
        }
        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);
            }
        }