Ejemplo n.º 1
0
        public async Task SaleWithLevel3ItemsTest()
        {
            var request = new SaleCreditCardRequest
            {
                CardNumber      = "4111111111111111",
                CVV             = "123",
                MonthExpiration = 12,
                YearExpiration  = DateTime.Now.AddYears(1).Year,
                Amount          = 101,
                CustomerInfo    = new CustomerInfo
                {
                    FirstName = "Name",
                    LastName  = "LastName"
                }
            };

            request.AdditionalInformation.OrderId    = RandomString(200);
            request.AdditionalInformation.AmountFood = 1;

            request.AdditionalInformation.Lvl3Information.Add(new Lvl3Information
            {
                CityTaxAmount = 1
            });
            request.AdditionalInformation.Lvl3Information.Add(new Lvl3Information
            {
                CityTaxAmount = 2
            });

            var response = await BluePayClient.SaleAsync(request);

            Assert.IsTrue(response.Status == Enums.StatusResponse.Approved);
        }
Ejemplo n.º 2
0
        private Task <BaseResponse> SaleAsync(decimal amount, Enums.Version version = Enums.Version.Version1)
        {
            var request = new SaleCreditCardRequest
            {
                CardNumber      = "4111111111111111",
                CVV             = "123",
                MonthExpiration = 12,
                YearExpiration  = DateTime.Now.AddYears(1).Year,
                Amount          = amount,
                CustomerInfo    = new CustomerInfo
                {
                    FirstName = "Name",
                    LastName  = "LastName"
                },
                Version = version
            };

            request.AdditionalInformation.OrderId = RandomString(200);

            request.AdditionalInformation.AmountFood = 1;

            return(BluePayClient.SaleAsync(request));
        }