public void Should_Delete_IyziLink() { IyziLinkSaveRequest request = new IyziLinkSaveRequest(); request.Locale = Locale.TR.ToString(); request.ConversationId = "123456789"; request.Name = "ft-name"; request.Description = "ft-description"; request.Base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8H8BwGwAF0QIs4BDpAAAAAABJRU5ErkJggg=="; request.Price = "1"; request.Currency = Currency.TRY.ToString(); request.AddressIgnorable = false; request.SoldLimit = 1; request.InstallmentRequested = false; string token = IyziLink.Create(request, _options).Data.Token; BaseRequestV2 requestV2 = new BaseRequestV2(); requestV2.Locale = Locale.TR.ToString(); requestV2.ConversationId = "123456789"; IyzipayResourceV2 response = IyziLink.Delete(token, requestV2, _options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.AreEqual(Locale.TR.ToString(), response.Locale); Assert.AreEqual("123456789", response.ConversationId); Assert.NotNull(response.SystemTime); }
public void Should_Retrieve_IyziLink_With_Token() { IyziLinkSaveRequest request = new IyziLinkSaveRequest(); request.Locale = Locale.TR.ToString(); request.ConversationId = "123456789"; request.Name = "ft-name"; request.Description = "ft-description"; request.Base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8H8BwGwAF0QIs4BDpAAAAAABJRU5ErkJggg=="; request.Price = "1"; request.Currency = Currency.TRY.ToString(); request.AddressIgnorable = false; request.SoldLimit = 1; request.InstallmentRequested = false; string token = IyziLink.Create(request, _options).Data.Token; BaseRequestV2 requestV2 = new BaseRequestV2(); requestV2.Locale = Locale.TR.ToString(); requestV2.ConversationId = "123456789"; ResponseData <IyziLinkItem> response = IyziLink.Retrieve(token, requestV2, _options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.AreEqual(Locale.TR.ToString(), response.Locale); Assert.AreEqual("123456789", response.ConversationId); Assert.NotNull(response.SystemTime); Assert.AreEqual("ft-name", response.Data.Name); Assert.AreEqual("ft-description", response.Data.Description); Assert.AreEqual("1", response.Data.Price.RemoveTrailingZeros()); Assert.AreEqual(Currency.TRY.ToString(), response.Data.Currency); Assert.AreEqual(token, response.Data.Token); Assert.AreEqual(IyziLinkStatus.ACTIVE, response.Data.IyziLinkStatus); Assert.AreEqual(false, response.Data.AddressIgnorable); Assert.NotNull(response.Data.ImageUrl); }
public void Should_Retrieve_IyziLinks_With_Pagination() { IyziLinkSaveRequest request = new IyziLinkSaveRequest(); request.Locale = Locale.TR.ToString(); request.ConversationId = "123456789"; request.Name = "ft-name"; request.Description = "ft-description"; request.Base64EncodedImage = "iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8H8BwGwAF0QIs4BDpAAAAAABJRU5ErkJggg=="; request.Price = "1"; request.Currency = Currency.TRY.ToString(); request.AddressIgnorable = false; request.SoldLimit = 1; request.InstallmentRequested = false; IyziLink.Create(request, _options); PagingRequest pagingRequest = new PagingRequest(); pagingRequest.Page = 1; pagingRequest.Count = 1; pagingRequest.Locale = Locale.TR.ToString(); pagingRequest.ConversationId = "123456789"; ResponsePagingData <IyziLinkItem> response = IyziLink.RetrieveAll(pagingRequest, _options); PrintResponse(response); Assert.AreEqual(Status.SUCCESS.ToString(), response.Status); Assert.AreEqual(Locale.TR.ToString(), response.Locale); Assert.AreEqual("123456789", response.ConversationId); Assert.NotNull(response.SystemTime); Assert.AreEqual(1, response.Data.Items.Count); Assert.AreEqual(1, response.Data.CurrentPage); }