public void CreateCustomerWithNoCard()
        {
            var customerCreateModel = TestHelper.GetCustomerCreateModelWithNoCard();
            var response            = CheckoutClient.CustomerService.CreateCustomer(customerCreateModel);

            response.Should().NotBeNull();
            response.HttpStatusCode.Should().Be(HttpStatusCode.OK);
            response.Model.Id.Should().StartWith("cust_");
            customerCreateModel.ShouldBeEquivalentTo(response.Model, options => options.Excluding(x => x.Card));
        }
        public void CreateCustomerWithNoCard()
        {
            var customerCreateModel = TestHelper.GetCustomerCreateModelWithNoCard();
            var response            = CheckoutClient.CustomerService.CreateCustomer(customerCreateModel);

            Assert.NotNull(response);
            Assert.IsTrue(response.HttpStatusCode == System.Net.HttpStatusCode.OK);
            Assert.IsTrue(response.Model.Id.StartsWith("cust_"));
            Assert.IsTrue(ReflectionHelper.CompareProperties(customerCreateModel, response.Model, new string[] { "Card" }));
        }
Ejemplo n.º 3
0
        public void GetCardList()
        {
            var customer      = CheckoutClient.CustomerService.CreateCustomer(TestHelper.GetCustomerCreateModelWithNoCard()).Model;
            var customerCard1 = CheckoutClient.CardService.CreateCard(customer.Id, TestHelper.GetCardCreateModel()).Model;
            var customerCard2 = CheckoutClient.CardService.CreateCard(customer.Id, TestHelper.GetCardCreateModel(CardProvider.Mastercard)).Model;

            var response = CheckoutClient.CardService.GetCardList(customer.Id);

            response.Should().NotBeNull();
            response.HttpStatusCode.Should().Be(HttpStatusCode.OK);
            response.Model.Count.Should().Be(2);
        }
        public void GetCardList()
        {
            var customer      = CheckoutClient.CustomerService.CreateCustomer(TestHelper.GetCustomerCreateModelWithNoCard()).Model;
            var customerCard1 = CheckoutClient.CardService.CreateCard(customer.Id, TestHelper.GetCardCreateModel(Utils.CardProvider.Visa)).Model;
            var customerCard2 = CheckoutClient.CardService.CreateCard(customer.Id, TestHelper.GetCardCreateModel(Utils.CardProvider.Mastercard)).Model;

            var response = CheckoutClient.CardService.GetCardList(customer.Id);

            Assert.NotNull(response);
            Assert.IsTrue(response.HttpStatusCode == System.Net.HttpStatusCode.OK);
            Assert.IsTrue(response.Model.Count == 2);
        }
Ejemplo n.º 5
0
        public void CreateCard()
        {
            var customer        = CheckoutClient.CustomerService.CreateCustomer(TestHelper.GetCustomerCreateModelWithNoCard()).Model;
            var cardCreateModel = TestHelper.GetCardCreateModel();
            var response        = CheckoutClient.CardService.CreateCard(customer.Id, cardCreateModel);

            response.Should().NotBeNull();
            response.HttpStatusCode.Should().Be(HttpStatusCode.OK);
            response.Model.Id.Should().StartWith("card_");
            response.Model.CustomerId.Should().BeEquivalentTo(customer.Id);
            response.Model.Name.Should().Be(cardCreateModel.Name);
            response.Model.ExpiryMonth.Should().Be(cardCreateModel.ExpiryMonth);
            response.Model.ExpiryYear.Should().Be(cardCreateModel.ExpiryYear);
            response.Model.Bin.Should().Be(cardCreateModel.Number.Substring(0, 6));
            cardCreateModel.Number.Should().EndWith(response.Model.Last4);
            cardCreateModel.BillingDetails.ShouldBeEquivalentTo(response.Model.BillingDetails);
        }
        public void CreateCard()
        {
            var customer = CheckoutClient.CustomerService.CreateCustomer(TestHelper.GetCustomerCreateModelWithNoCard()).Model;

            var cardCreateModel = TestHelper.GetCardCreateModel();
            var response        = CheckoutClient.CardService.CreateCard(customer.Id, cardCreateModel);

            Assert.NotNull(response);
            Assert.IsTrue(response.HttpStatusCode == System.Net.HttpStatusCode.OK);
            Assert.IsTrue(response.Model.Id.StartsWith("card_"));
            Assert.IsTrue(response.Model.CustomerId.Equals(customer.Id, System.StringComparison.OrdinalIgnoreCase));
            Assert.IsTrue(response.Model.Name == cardCreateModel.Name);
            Assert.IsTrue(response.Model.ExpiryMonth == cardCreateModel.ExpiryMonth);
            Assert.IsTrue(response.Model.ExpiryYear == cardCreateModel.ExpiryYear);
            Assert.IsTrue(cardCreateModel.Number.EndsWith(response.Model.Last4));
            Assert.IsTrue(ReflectionHelper.CompareProperties(cardCreateModel.BillingDetails, response.Model.BillingDetails));
        }