diff --git a/Iyzipay.Tests/Functional/BinNumberTest.cs b/Iyzipay.Tests/Functional/BinNumberTest.cs index e114bec..785978a 100644 --- a/Iyzipay.Tests/Functional/BinNumberTest.cs +++ b/Iyzipay.Tests/Functional/BinNumberTest.cs @@ -30,7 +30,37 @@ public void Should_Retrieve_Bin() Assert.AreEqual("MASTER_CARD", binNumber.CardAssociation); Assert.AreEqual("Bonus", binNumber.CardFamily); Assert.AreEqual("Garanti Bankası", binNumber.BankName); + Assert.AreEqual(0, binNumber.Commercial); Assert.AreEqual(62, binNumber.BankCode); } + + [Test] + public void Should_Retrieve_Bin_With_Commercial_One() + { + RetrieveBinNumberRequest request = RetrieveBinNumberRequestBuilder.Create() + .BinNumber("552659") + .Build(); + + BinNumber binNumber = BinNumber.Retrieve(request, _options); + + PrintResponse(request); + + Assert.AreEqual(Status.SUCCESS.ToString(), binNumber.Status); + Assert.AreEqual(Locale.TR.ToString(), binNumber.Locale); + Assert.AreEqual("123456789", binNumber.ConversationId); + Assert.NotNull(binNumber.SystemTime); + Assert.Null(binNumber.ErrorCode); + Assert.Null(binNumber.ErrorMessage); + Assert.Null(binNumber.ErrorGroup); + Assert.AreEqual("552659", binNumber.Bin); + Assert.AreEqual("CREDIT_CARD", binNumber.CardType); + Assert.AreEqual("MASTER_CARD", binNumber.CardAssociation); + Assert.AreEqual("World", binNumber.CardFamily); + Assert.AreEqual("Yapı Kredi Bankası", binNumber.BankName); + Assert.AreEqual(1, binNumber.Commercial); + Assert.AreEqual(67, binNumber.BankCode); + } } + + } diff --git a/Iyzipay.Tests/Functional/InstallmentTest.cs b/Iyzipay.Tests/Functional/InstallmentTest.cs index e53c63f..81e5d23 100644 --- a/Iyzipay.Tests/Functional/InstallmentTest.cs +++ b/Iyzipay.Tests/Functional/InstallmentTest.cs @@ -28,6 +28,41 @@ public void Should_Retrieve_Installments() Assert.AreEqual("CREDIT_CARD", installmentInfo.InstallmentDetails[0].CardType); Assert.AreEqual("MASTER_CARD", installmentInfo.InstallmentDetails[0].CardAssociation); Assert.AreEqual("Bonus", installmentInfo.InstallmentDetails[0].CardFamilyName); + Assert.AreEqual(0, installmentInfo.InstallmentDetails[0].Commercial); + Assert.NotNull(installmentInfo.InstallmentDetails[0].InstallmentPrices[0].InstallmentNumber); + Assert.NotNull(installmentInfo.InstallmentDetails[0].InstallmentPrices[0].Price); + Assert.NotNull(installmentInfo.InstallmentDetails[0].InstallmentPrices[0].TotalPrice); + Assert.NotNull(installmentInfo.SystemTime); + Assert.Null(installmentInfo.ErrorCode); + Assert.Null(installmentInfo.ErrorMessage); + Assert.Null(installmentInfo.ErrorGroup); + Assert.NotNull(installmentInfo.InstallmentDetails); + Assert.False(installmentInfo.InstallmentDetails.Count == 0); + } + + [Test] + public void Should_Retrieve_Installments_With_Commercial_One() + { + RetrieveInstallmentInfoRequest request = new RetrieveInstallmentInfoRequest(); + request.Locale = Locale.TR.ToString(); + request.ConversationId = "123456789"; + request.BinNumber = "552659"; + request.Price = "100"; + + InstallmentInfo installmentInfo = InstallmentInfo.Retrieve(request, _options); + + PrintResponse(installmentInfo); + + Assert.AreEqual(Status.SUCCESS.ToString(), installmentInfo.Status); + Assert.AreEqual(Locale.TR.ToString(), installmentInfo.Locale); + Assert.AreEqual("123456789", installmentInfo.ConversationId); + Assert.NotNull(installmentInfo.InstallmentDetails[0]); + Assert.AreEqual("552659", installmentInfo.InstallmentDetails[0].BinNumber); + Assert.AreEqual("100", installmentInfo.InstallmentDetails[0].Price); + Assert.AreEqual("CREDIT_CARD", installmentInfo.InstallmentDetails[0].CardType); + Assert.AreEqual("MASTER_CARD", installmentInfo.InstallmentDetails[0].CardAssociation); + Assert.AreEqual("World", installmentInfo.InstallmentDetails[0].CardFamilyName); + Assert.AreEqual(1, installmentInfo.InstallmentDetails[0].Commercial); Assert.NotNull(installmentInfo.InstallmentDetails[0].InstallmentPrices[0].InstallmentNumber); Assert.NotNull(installmentInfo.InstallmentDetails[0].InstallmentPrices[0].Price); Assert.NotNull(installmentInfo.InstallmentDetails[0].InstallmentPrices[0].TotalPrice); diff --git a/Iyzipay/Model/BinNumber.cs b/Iyzipay/Model/BinNumber.cs index 5643535..1549113 100644 --- a/Iyzipay/Model/BinNumber.cs +++ b/Iyzipay/Model/BinNumber.cs @@ -13,6 +13,7 @@ public class BinNumber : IyzipayResource public String CardFamily { get; set; } public String BankName { get; set; } public long BankCode { get; set; } + public int Commercial { get; set; } public static BinNumber Retrieve(RetrieveBinNumberRequest request, Options options) { diff --git a/Iyzipay/Model/InstallmentDetail.cs b/Iyzipay/Model/InstallmentDetail.cs index d977c10..4ba74ad 100644 --- a/Iyzipay/Model/InstallmentDetail.cs +++ b/Iyzipay/Model/InstallmentDetail.cs @@ -6,6 +6,7 @@ namespace Iyzipay.Model public class InstallmentDetail { public String BinNumber { get; set; } + public int Commercial { get; set; } public String Price { get; set; } public String CardType { get; set; } public String CardAssociation { get; set; }