{"id":823,"date":"2025-11-14T18:49:08","date_gmt":"2025-11-14T18:49:08","guid":{"rendered":"https:\/\/rafty.dk\/?page_id=823"},"modified":"2025-12-01T16:29:57","modified_gmt":"2025-12-01T16:29:57","slug":"payment-expired-test","status":"publish","type":"page","link":"https:\/\/rafty.dk\/da\/payment-expired-test\/","title":{"rendered":"Payment expired &#8211; test"},"content":{"rendered":"<script>\nfunction updatePaymentStatus(_status){\n\tlet http = new XMLHttpRequest();\/\/Using XMLHttpRequest to call the server and get the data\n\t\n\tlet url = '\/wp-content\/plugins\/rafty-booking-test\/booking_update_status.php';\n\n\tlet params = 'booking_id=' + sessionStorage.getItem(\"bookingId\") + '&payment_status=' + _status;\n\thttp.open('POST', url, true);\n\t\/\/Send the proper header information along with the request\n\thttp.setRequestHeader('Content-type', 'application\/x-www-form-urlencoded');\n\thttp.onreadystatechange = function() {\/\/Call a function when the state changes.\n\t\tif(http.readyState == 4 && http.status == 508) {\n\t\t\tsetTimeout(function(){updatePaymentStatus(_status)}, 300);\n\t\t}\n\t\tif(http.readyState == 4 && http.status == 200) {\n\t\t\tlet okrow = JSON.parse(http.responseText);\n\t\t\tif (okrow.result == 'ok'){\t\t\t\t\t\n\t\t\t}else{\t\n\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\thttp.onerror = function() {;}\t\t\n\thttp.send(params);\t\n}\t\n\ndocument.addEventListener(\"DOMContentLoaded\", function(e) {\n\tif (sessionStorage.getItem(\"bookingId\") != null){\n\t\tupdatePaymentStatus(\"EXPIRED\");\n\t\tsessionStorage.removeItem(\"bookingId\");\n\t\tsessionStorage.removeItem(\"orderId\");\n\t\tsessionStorage.setItem(\"rafty_init\", \"rafty_end\");\n\t}else window.location.replace(\"\/\");\n});\n<\/script>\n\n<br><div style=\"text-align:center;\">\n<img decoding=\"async\" src=\"\/wp-content\/plugins\/rafty-booking-test\/Images\/error-icon-25243.png\" alt=\"erroricon\" style=\"width:36px;height:36px;margin-left:auto;margin-right:auto;\">\n<div><strong>Betaling er udl\u00f8bet<\/strong><\/div>\n<\/div>\n\n\n\n<!-- wp:themify-builder\/canvas \/-->","protected":false},"excerpt":{"rendered":"","protected":false},"author":5,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-823","page","type-page","status-publish","hentry","has-post-title","has-post-date","has-post-category","has-post-tag","has-post-comment","has-post-author",""],"builder_content":"","_links":{"self":[{"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/pages\/823","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/comments?post=823"}],"version-history":[{"count":5,"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/pages\/823\/revisions"}],"predecessor-version":[{"id":912,"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/pages\/823\/revisions\/912"}],"wp:attachment":[{"href":"https:\/\/rafty.dk\/da\/wp-json\/wp\/v2\/media?parent=823"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}