{"id":38727,"date":"2025-05-06T13:30:52","date_gmt":"2025-05-06T10:30:52","guid":{"rendered":"https:\/\/turanturan.com.tr\/?page_id=38727"},"modified":"2025-09-02T18:10:59","modified_gmt":"2025-09-02T15:10:59","slug":"payment-successful","status":"publish","type":"page","link":"https:\/\/turanturan.com.tr\/en\/payment-successful\/","title":{"rendered":"Payment Successful"},"content":{"rendered":"\n<div class=\"gb-element-6b3cbb3c\" style=\"--inline-bg-image: url(https:\/\/turanturan.com.tr\/wp-content\/uploads\/2021\/03\/page-title.jpg)\">\n<div class=\"gb-element-6419b2ad\">\n<h1 class=\"gb-text gb-text-ef6896ed\">Payment Successful<\/h1>\n<\/div>\n<\/div>\n\n\n\n<div class=\"gb-element-b54d5669\">\n<div class=\"gb-element-393e138d\">\n<style>\r\n    .payment-container{\r\n        max-width: 750px;\r\n        width: 100%;\r\n        border: 1px solid #ccc;\r\n        border-radius: 10px;\r\n        padding: 10px;\r\n        display: flex;\r\n        flex-direction: column;\r\n        gap: 10px 0px;\r\n        justify-content: center;\r\n        align-self: center;\r\n    }\r\n    h2,h3 {\r\n        margin: 0px;\r\n    }\r\n    .flex {\r\n        display: flex;\r\n        flex-direction: row;\r\n        gap: 0px 10px;\r\n        align-items: center;\r\n        border-bottom: 1px solid #aaa;\r\n    }\r\n    .flex h3 {\r\n        width: 50%;\r\n    }\r\n    .container {\r\n        display: flex;\r\n        flex-direction: column;\r\n        align-items: center;\r\n        justify-content: center;\r\n        width: 100%;\r\n    }\r\n    .custom-btn {\r\n        padding: 10px 20px;\r\n        border-radius: 5px;\r\n        background-color: #fff;\r\n        color: #007BFF;\r\n        border: 2px solid #007BFF;\r\n        cursor: pointer;\r\n        font-size: 16px;\r\n        margin-top: 20px;\r\n        transition: 0.3s linear;\r\n    }\r\n    .custom-btn:hover {\r\n        background-color: #007BFF;\r\n        color: #fff;\r\n        transition: 0.3s linear;\r\n\r\n    }\r\n    @media (max-width: 767px) {\r\n        h3 {\r\n            font-size: 14px;    \r\n        }\r\n    }\r\n<\/style>\r\n<body>\r\n    <!-- <h1 style=\"text-align: center;\">Thank you for your payment! We will contact you as soon as possible.<\/h1> -->\r\n    <div class=\"container\">\r\n        <h1>Thank You for Choosing Us<\/h1>\r\n        <div class=\"payment-container\">\r\n            <div class=\"flex\">\r\n                <h3>Name Surname<\/h3>\r\n                <h3 id=\"name\"><\/h3>\r\n            <\/div>\r\n            <div class=\"flex\">\r\n                <h3>Referance Code<\/h3>\r\n                <h3 id=\"referancecode\"><\/h3>\r\n            <\/div>\r\n            <div class=\"flex\">\r\n                <h3>Order ID<\/h3>\r\n                <h3 id=\"orderid\"><\/h3>\r\n            <\/div>\r\n            <div class=\"flex\">\r\n                <h3>Amount<\/h3>\r\n                <h3 id=\"amount\"><\/h3>\r\n            <\/div>\r\n            <div class=\"flex\">\r\n                <h3>Payment Date<\/h3>\r\n                <h3 id=\"dateofpaid\"><\/h3>\r\n            <\/div>\r\n        <\/div>\r\n        <button class=\"custom-btn\" id=\"download-pdf\">Download PDF<\/button>\r\n    <\/div>\r\n<\/body>\r\n<script src=\"https:\/\/cdnjs.cloudflare.com\/ajax\/libs\/jspdf\/2.4.0\/jspdf.umd.min.js\"><\/script>\r\n<script>\r\n    const params = new URLSearchParams(window.location.search);\r\n    const referanceCode = params.get('referance_code');\r\n    console.log(referanceCode);\r\n\r\n    const postData = {\r\n        type : \"payment_check\",\r\n        referance_code : referanceCode\r\n    }\r\n\r\n    fetch(\"https:\/\/console.turanturan.com.tr\/api\/online-consultation-referance.php\", {\r\n        method: \"POST\",\r\n        headers: {\r\n            \"Content-Type\": \"application\/json\"\r\n        },\r\n        body: JSON.stringify(postData)\r\n    })\r\n    .then((response) => {\r\n    \r\n        return response.json(); \/\/ JSON yan\u0131t\u0131 i\u015fleyin\r\n        \r\n    })\r\n    .then((data) => {\r\n        console.log(\"data\",data); \/\/ Ba\u015far\u0131l\u0131 yan\u0131t\u0131 konsola yazd\u0131r\r\n        if (data.status == \"success\") {\r\n            const name = document.getElementById(\"name\");\r\n            const referancecode = document.getElementById(\"referancecode\");\r\n            const orderid = document.getElementById(\"orderid\");\r\n            const dateofpaid = document.getElementById(\"dateofpaid\");\r\n            const amount = document.getElementById(\"amount\");\r\n\r\n            amount.innerText = data.data.amount + ' $';\r\n            name.innerText = data.data.name;\r\n            referancecode.innerText = data.data.referance_code;\r\n            orderid.innerText = data.data.order_id;\r\n\r\n            const dateObject = new Date(data.data.created_at); \/\/ Tarihi Date nesnesine d\u00f6n\u00fc\u015ft\u00fcr\r\n\r\n            \/\/ G\u00fcn, Ay, Y\u0131l, Saat ve Dakikay\u0131 al\u0131n\r\n            const day = String(dateObject.getDate()).padStart(2, '0'); \/\/ 30\r\n            const month = String(dateObject.getMonth() + 1).padStart(2, '0'); \/\/ 12 (Aylar 0'dan ba\u015flar)\r\n            const year = dateObject.getFullYear(); \/\/ 2024\r\n            const hours = String(dateObject.getHours()).padStart(2, '0'); \/\/ 14\r\n            const minutes = String(dateObject.getMinutes()).padStart(2, '0'); \/\/ 42\r\n\r\n            \/\/ Yeni formatta birle\u015ftir\r\n            const formattedDate = `${day}\/${month}\/${year} ${hours}:${minutes}`;\r\n\r\n            dateofpaid.innerText = formattedDate;\r\n        }\r\n    })\r\n    .catch((error) => {\r\n        console.error(\"Hata:\", error);\r\n    });\r\n\r\n    document.getElementById('download-pdf').addEventListener('click', function () {\r\n        \/\/ jsPDF k\u00fct\u00fcphanesini ba\u015flat\r\n        const { jsPDF } = window.jspdf;\r\n        const doc = new jsPDF();\r\n\r\n        \/\/ HTML i\u00e7eri\u011finden verileri al\r\n        const name = document.getElementById('name').innerText;\r\n        const referanceCode = document.getElementById('referancecode').innerText;\r\n        const orderId = document.getElementById('orderid').innerText;\r\n        const dateOfPaid = document.getElementById('dateofpaid').innerText;\r\n        const amount = document.getElementById('amount').innerText;\r\n        \/\/ PDF i\u00e7eri\u011fini olu\u015ftur\r\n        doc.setFontSize(16);\r\n        doc.text('Thank you for your payment', 10, 10);\r\n        doc.setFontSize(12);\r\n        doc.text(`Name Surname: ${name}`, 10, 30);\r\n        doc.text(`Referance Code: ${referanceCode}`, 10, 40);\r\n        doc.text(`Order ID: ${orderId}`, 10, 50);\r\n        doc.text(`Amount: ${amount}`, 10, 60);\r\n        doc.text(`Payment Date: ${dateOfPaid}`, 10, 70);\r\n\r\n        \/\/ PDF dosyas\u0131n\u0131 indir\r\n        doc.save(`${referanceCode}.pdf`);\r\n    });\r\n<\/script>\n<\/div>\n<\/div>\n\n\n\n<style>.site-content{width:100%} .inside-article{padding:0px !important}<\/style>\n","protected":false},"excerpt":{"rendered":"<p>Payment Successful<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-38727","page","type-page","status-publish"],"_links":{"self":[{"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/pages\/38727","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/comments?post=38727"}],"version-history":[{"count":3,"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/pages\/38727\/revisions"}],"predecessor-version":[{"id":53913,"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/pages\/38727\/revisions\/53913"}],"wp:attachment":[{"href":"https:\/\/turanturan.com.tr\/en\/wp-json\/wp\/v2\/media?parent=38727"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}