Exemplo n.º 1
0
        public void Should_Retrieve_IyziLink_With_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(Currency.TRY.ToString(), response.Data.Currency);
            Assert.AreEqual(IyziLinkStatus.ACTIVE, response.Data.IyziLinkStatus);
            Assert.AreEqual(false, response.Data.AddressIgnorable);
            Assert.NotNull(response.Data.ImageUrl);
        }
Exemplo n.º 2
0
        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);
        }