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); }
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)); }
public void DeleteSecondaryCard() { var customer = CheckoutClient.CustomerService.CreateCustomer(TestHelper.GetCustomerCreateModelWithCard()).Model; var customerPrimaryCardId = customer.Cards.Data.First().Id; var customerSecondaryCardId = CheckoutClient.CardService.CreateCard(customer.Id, TestHelper.GetCardCreateModel(CardProvider.Mastercard)).Model.Id; var response = CheckoutClient.CardService.DeleteCard(customer.Id, customerSecondaryCardId); response.Should().NotBeNull(); response.HttpStatusCode.Should().Be(HttpStatusCode.OK); response.Model.Message.Should().BeEquivalentTo("Ok"); }