コード例 #1
0
        public async Task Test_GetPaymentProviders()
        {
            // Initialize Xente class
            XentePayment xenteGateWay = TestHelper.InitializeXenteGateWay();

            PaymentProvidersResponse paymentProvidersResponse = await xenteGateWay.PaymentProviders.GetPaymentProviders();

            // The length of the payment providers should be greater than zero
            Assert.IsTrue(paymentProvidersResponse.Data.Collection.Count > 0);
        }
コード例 #2
0
        public static async Task GetAllPaymentProvidersAsync()
        {
            try
            {
                string dottedLine = "...............................................";
                PaymentProvidersResponse paymentProvidersResponse = await xentePaymentGateway.PaymentProviders.GetPaymentProviders();

                Console.WriteLine("Message = {0}", paymentProvidersResponse.Message);
                Console.WriteLine("Code = {0}", paymentProvidersResponse.Code);
                Console.WriteLine("Correlation ID = {0}{1}\n", paymentProvidersResponse.CorrelationId, dottedLine);

                Console.WriteLine("Data Information");
                Console.WriteLine("Current Page = {0}", paymentProvidersResponse.Data.CurrentPage);
                Console.WriteLine("Page Size = {0}", paymentProvidersResponse.Data.PageSize);
                Console.WriteLine("Total Page = {0}", paymentProvidersResponse.Data.TotalPages);
                Console.WriteLine("Previous Page = {0}", paymentProvidersResponse.Data.PreviousPage);
                Console.WriteLine("Next Page = {0}{1}\n", paymentProvidersResponse.Data.NextPage, dottedLine);

                Console.WriteLine($"Payment Providers Colection\n{dottedLine}");

                foreach (PaymentProviderResponse paymentProviderResponse in paymentProvidersResponse.Data.Collection)
                {
                    Console.WriteLine("Payment Provider with ID = {0}", paymentProviderResponse.PaymentId);
                    Console.WriteLine("Payment ID = {0}", paymentProviderResponse.PaymentId);
                    Console.WriteLine("Image URI = {0}", paymentProviderResponse.ImageUri);
                    Console.WriteLine("Name = {0}", paymentProviderResponse.Name);
                    Console.WriteLine("Category = {0}", paymentProviderResponse.Category);
                    Console.WriteLine("Short Description = {0}", paymentProviderResponse.ShortDescription);
                    Console.WriteLine("Long Description = {0}", paymentProviderResponse.LongDescription);
                    Console.WriteLine("Country Code = {0}", paymentProviderResponse.CountryCode);
                    Console.WriteLine("Currency Code = {0}", paymentProviderResponse.CurrencyCode);
                    Console.WriteLine("Is Deleted = {0}", paymentProviderResponse.IsDeleted);
                    Console.WriteLine("Is Active = {0}", paymentProviderResponse.IsActive);
                    Console.WriteLine("Is External = {0}", paymentProviderResponse.IsExternal);
                    Console.WriteLine("");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex);
            }
        }