コード例 #1
0
        public void Should_Initialize_Threeds_With_Card()
        {
            CreateConnectThreeDSInitializeRequest request = new CreateConnectThreeDSInitializeRequest();

            request.Locale         = Locale.TR.GetName();
            request.ConversationId = "123456789";
            request.BuyerEmail     = "*****@*****.**";
            request.BuyerId        = "B2323";
            request.BuyerIp        = "127.0.0.1";
            request.ConnectorName  = "ISBANK";
            request.Installment    = 1;
            request.PaidPrice      = "1.0";
            request.Price          = "1.0";
            request.CallbackUrl    = "https://www.merchant.com/callbackUrl";

            PaymentCard paymentCard = new PaymentCard();

            paymentCard.CardHolderName = "John Doe";
            paymentCard.CardNumber     = "5528790000000008";
            paymentCard.ExpireMonth    = "12";
            paymentCard.ExpireYear     = "2030";
            paymentCard.Cvc            = "123";
            paymentCard.RegisterCard   = 0;
            request.PaymentCard        = paymentCard;

            ConnectThreeDSInitialize connectThreeDSInitialize = ConnectThreeDSInitialize.Create(request, options);

            PrintResponse <ConnectThreeDSInitialize>(connectThreeDSInitialize);

            Assert.IsNotNull(connectThreeDSInitialize.SystemTime);
            Assert.AreEqual(Status.SUCCESS.ToString(), connectThreeDSInitialize.Status);
            Assert.AreEqual(Locale.TR.GetName(), connectThreeDSInitialize.Locale);
            Assert.AreEqual("123456789", connectThreeDSInitialize.ConversationId);
        }
コード例 #2
0
        public void Should_Initialize_Threeds_With_Card_Token()
        {
            CreateConnectThreeDSInitializeRequest request = new CreateConnectThreeDSInitializeRequest();

            request.Locale         = Locale.TR.GetName();
            request.ConversationId = "123456789";
            request.BuyerEmail     = "*****@*****.**";
            request.BuyerId        = "B2323";
            request.BuyerIp        = "127.0.0.1";
            request.ConnectorName  = "connector name";
            request.Installment    = 1;
            request.PaidPrice      = "1.0";
            request.Price          = "1.0";
            request.CallbackUrl    = "https://www.merchant.com/callbackUrl";

            PaymentCard paymentCard = new PaymentCard();

            paymentCard.CardToken   = "card token";
            paymentCard.CardUserKey = "card user key";
            request.PaymentCard     = paymentCard;

            ConnectThreeDSInitialize connectThreeDSInitialize = ConnectThreeDSInitialize.Create(request, options);

            PrintResponse <ConnectThreeDSInitialize>(connectThreeDSInitialize);

            Assert.IsNotNull(connectThreeDSInitialize.SystemTime);
            Assert.AreEqual(Status.SUCCESS.ToString(), connectThreeDSInitialize.Status);
            Assert.AreEqual(Locale.TR.GetName(), connectThreeDSInitialize.Locale);
            Assert.AreEqual("123456789", connectThreeDSInitialize.ConversationId);
        }
コード例 #3
0
        public static ConnectThreeDSInitialize Create(CreateConnectThreeDSInitializeRequest request, Options options)
        {
            ConnectThreeDSInitialize response = RestHttpClient.Create().Post <ConnectThreeDSInitialize>(options.BaseUrl + "/payment/iyziconnect/initialize3ds", GetHttpHeaders(request, options), request);

            if (response != null)
            {
                response.HtmlContent = DigestHelper.decodeString(response.HtmlContent);
            }
            return(response);
        }