Esempio n. 1
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var clientReferenceInformationObj = new V2paymentsidreversalsClientReferenceInformation("Testing");
            var amount           = new V2paymentsidreversalsOrderInformationLineItems(null, "102.21");
            var amountDetailsObj = new List <V2paymentsidreversalsOrderInformationLineItems> {
                amount
            };
            var orderInformationObj = new V2paymentsidreversalsOrderInformation(amountDetailsObj);
            var requestBody         = new AuthReversalRequest(clientReferenceInformationObj, null, null, orderInformationObj);

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

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new ReversalApi(configurationSwagger);
                var result = apiInstance.AuthReversal("5343950179766232704003", requestBody);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Esempio n. 2
0
        public static void Run(IReadOnlyDictionary <string, string> configDictionary)
        {
            var requestObj = new AuthReversalRequest();

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

            requestObj.ClientReferenceInformation = v2PaymentsClientReferenceInformationObj;

            // var v2paymentsOrderInformationObj = new V2paymentsidreversalsOrderInformation();

            // var amountDetailsObj = new V2paymentsidreversalsOrderInformationAmountDetails();

            // amountDetailsObj.Currency = "USD";
            // v2paymentsOrderInformationObj.AmountDetails = amountDetailsObj;

            // requestObj.OrderInformation = v2paymentsOrderInformationObj;

            var reversalInformationObj = new V2paymentsidreversalsReversalInformation();

            var amountDetailsObj = new V2paymentsidreversalsReversalInformationAmountDetails
            {
                TotalAmount = "3000.00"
            };

            reversalInformationObj.AmountDetails = amountDetailsObj;

            requestObj.ReversalInformation = reversalInformationObj;

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

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

            var clientReferenceInformationObj = new V2paymentsidreversalsClientReferenceInformation("TC50171_1");

            // var amount = new V2paymentsidreversalsOrderInformationLineItems();
            // amount.Currency = "USD";
            // var amountDetailsObj = new List<V2paymentsidreversalsOrderInformationLineItems> { amount };
            // var orderInformationObj = new V2paymentsidreversalsOrderInformation(amountDetailsObj);

            var amountDetailsObj = new V2paymentsidreversalsReversalInformationAmountDetails
            {
                TotalAmount = "100.00"
            };

            var reversalInformationObj = new V2paymentsidreversalsReversalInformation
            {
                AmountDetails = amountDetailsObj
            };

            requestObj.ClientReferenceInformation = clientReferenceInformationObj;
            requestObj.ReversalInformation        = reversalInformationObj;

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

            try
            {
                var configurationSwagger = new ApiClient().CallAuthenticationHeader(merchantConfig);
                var apiInstance          = new ReversalApi(configurationSwagger);
                var result = apiInstance.AuthReversal("5334411871436531903527", requestObj);
                Console.WriteLine(result);
            }
            catch (Exception e)
            {
                Console.WriteLine("Exception on calling the API: " + e.Message);
            }
        }
Esempio n. 4
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. 5
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);
            }
        }