{"id":54,"date":"2025-06-02T11:58:16","date_gmt":"2025-06-02T11:58:16","guid":{"rendered":"http:\/\/localhost\/plugin_demo\/smart-appointment-booking-pro\/products-demo\/?page_id=54"},"modified":"2025-06-17T07:48:01","modified_gmt":"2025-06-17T07:48:01","slug":"smart-appointment-booking-pro","status":"publish","type":"page","link":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/","title":{"rendered":"Smart Appointment Booking Pro"},"content":{"rendered":"\t\t\t<!-- Preloader element -->\n\t\t\t\t\t\t\t\t\t\t\t<div id=\"formio\"><\/div>\n\t\t\t\t\t\t\t\t<div id=\"formio_res_msg\" ><\/div>\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<script type='text\/javascript'>\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar myScriptData = [{\"label\":\"Name\",\"labelPosition\":\"top\",\"placeholder\":\"\",\"description\":\"\",\"tooltip\":\"\",\"prefix\":\"\",\"suffix\":\"\",\"widget\":{\"type\":\"input\"},\"inputMask\":\"\",\"displayMask\":\"\",\"allowMultipleMasks\":false,\"customClass\":\"\",\"tabindex\":\"\",\"autocomplete\":\"\",\"hidden\":false,\"hideLabel\":false,\"showWordCount\":false,\"showCharCount\":false,\"mask\":false,\"autofocus\":false,\"spellcheck\":true,\"disabled\":false,\"tableView\":true,\"modalEdit\":false,\"multiple\":false,\"persistent\":true,\"inputFormat\":\"plain\",\"protected\":false,\"dbIndex\":false,\"case\":\"\",\"truncateMultipleSpaces\":false,\"encrypted\":false,\"redrawOn\":\"\",\"clearOnHide\":true,\"customDefaultValue\":\"\",\"calculateValue\":\"\",\"calculateServer\":false,\"allowCalculateOverride\":false,\"validateOn\":\"change\",\"validate\":{\"required\":true,\"pattern\":\"\",\"customMessage\":\"\",\"custom\":\"\",\"customPrivate\":false,\"json\":\"\",\"minLength\":\"\",\"maxLength\":\"\",\"strictDateValidation\":false,\"multiple\":false,\"unique\":false},\"unique\":false,\"errorLabel\":\"\",\"errors\":\"\",\"key\":\"name\",\"tags\":[],\"properties\":{},\"conditional\":{\"show\":null,\"when\":null,\"eq\":\"\",\"json\":\"\"},\"customConditional\":\"\",\"logic\":[],\"attributes\":{},\"overlay\":{\"style\":\"\",\"page\":\"\",\"left\":\"\",\"top\":\"\",\"width\":\"\",\"height\":\"\"},\"type\":\"textfield\",\"input\":true,\"refreshOn\":\"\",\"dataGridLabel\":false,\"addons\":[],\"inputType\":\"text\",\"id\":\"esg75lk\",\"defaultValue\":\"\"},{\"label\":\"Email\",\"labelPosition\":\"top\",\"placeholder\":\"\",\"description\":\"\",\"tooltip\":\"\",\"prefix\":\"\",\"suffix\":\"\",\"widget\":{\"type\":\"input\"},\"displayMask\":\"\",\"customClass\":\"\",\"tabindex\":\"\",\"autocomplete\":\"\",\"hidden\":false,\"hideLabel\":false,\"mask\":false,\"autofocus\":false,\"spellcheck\":true,\"disabled\":false,\"tableView\":true,\"modalEdit\":false,\"multiple\":false,\"persistent\":true,\"inputFormat\":\"plain\",\"protected\":false,\"dbIndex\":false,\"case\":\"\",\"truncateMultipleSpaces\":false,\"encrypted\":false,\"redrawOn\":\"\",\"clearOnHide\":true,\"customDefaultValue\":\"\",\"calculateValue\":\"\",\"calculateServer\":false,\"allowCalculateOverride\":false,\"validateOn\":\"change\",\"validate\":{\"required\":false,\"pattern\":\"\",\"customMessage\":\"\",\"custom\":\"\",\"customPrivate\":false,\"json\":\"\",\"minLength\":\"\",\"maxLength\":\"\",\"strictDateValidation\":false,\"multiple\":false,\"unique\":false},\"unique\":false,\"kickbox\":{\"enabled\":false},\"errorLabel\":\"\",\"errors\":\"\",\"key\":\"email\",\"tags\":[],\"properties\":{},\"conditional\":{\"show\":null,\"when\":null,\"eq\":\"\",\"json\":\"\"},\"customConditional\":\"\",\"logic\":[],\"attributes\":{},\"overlay\":{\"style\":\"\",\"page\":\"\",\"left\":\"\",\"top\":\"\",\"width\":\"\",\"height\":\"\"},\"type\":\"email\",\"input\":true,\"refreshOn\":\"\",\"dataGridLabel\":false,\"showCharCount\":false,\"showWordCount\":false,\"allowMultipleMasks\":false,\"addons\":[],\"inputType\":\"email\",\"inputMask\":\"\",\"id\":\"e8mkry\",\"defaultValue\":null},{\"label\":\"Phone Number\",\"labelPosition\":\"top\",\"placeholder\":\"\",\"description\":\"\",\"tooltip\":\"\",\"prefix\":\"\",\"suffix\":\"\",\"widget\":{\"type\":\"input\"},\"inputMask\":\"(999) 999-9999\",\"displayMask\":\"\",\"allowMultipleMasks\":false,\"customClass\":\"\",\"tabindex\":\"\",\"autocomplete\":\"\",\"hidden\":false,\"hideLabel\":false,\"mask\":false,\"autofocus\":false,\"spellcheck\":true,\"disabled\":false,\"tableView\":true,\"modalEdit\":false,\"multiple\":false,\"persistent\":true,\"inputFormat\":\"plain\",\"protected\":false,\"dbIndex\":false,\"case\":\"\",\"truncateMultipleSpaces\":false,\"encrypted\":false,\"redrawOn\":\"\",\"clearOnHide\":true,\"customDefaultValue\":\"\",\"calculateValue\":\"\",\"calculateServer\":false,\"allowCalculateOverride\":false,\"validateOn\":\"change\",\"validate\":{\"required\":false,\"customMessage\":\"\",\"custom\":\"\",\"customPrivate\":false,\"json\":\"\",\"strictDateValidation\":false,\"multiple\":false,\"unique\":false,\"minLength\":\"\",\"maxLength\":\"\",\"pattern\":\"\"},\"unique\":false,\"errorLabel\":\"\",\"errors\":\"\",\"key\":\"phoneNumber\",\"tags\":[],\"properties\":{},\"conditional\":{\"show\":null,\"when\":null,\"eq\":\"\",\"json\":\"\"},\"customConditional\":\"\",\"logic\":[],\"attributes\":{},\"overlay\":{\"style\":\"\",\"page\":\"\",\"left\":\"\",\"top\":\"\",\"width\":\"\",\"height\":\"\"},\"type\":\"phoneNumber\",\"input\":true,\"refreshOn\":\"\",\"dataGridLabel\":false,\"showCharCount\":false,\"showWordCount\":false,\"addons\":[],\"inputType\":\"tel\",\"inputMode\":\"decimal\",\"id\":\"eg6aa4d\",\"defaultValue\":null},{\"type\":\"button\",\"label\":\"Submit\",\"key\":\"submit\",\"size\":\"md\",\"block\":false,\"action\":\"submit\",\"disableOnInvalid\":true,\"theme\":\"primary\",\"input\":true,\"placeholder\":\"\",\"prefix\":\"\",\"customClass\":\"\",\"suffix\":\"\",\"multiple\":false,\"defaultValue\":null,\"protected\":false,\"unique\":false,\"persistent\":false,\"hidden\":false,\"clearOnHide\":true,\"refreshOn\":\"\",\"redrawOn\":\"\",\"tableView\":false,\"modalEdit\":false,\"dataGridLabel\":true,\"labelPosition\":\"top\",\"description\":\"\",\"errorLabel\":\"\",\"tooltip\":\"\",\"hideLabel\":false,\"tabindex\":\"\",\"disabled\":false,\"autofocus\":false,\"dbIndex\":false,\"customDefaultValue\":\"\",\"calculateValue\":\"\",\"calculateServer\":false,\"widget\":{\"type\":\"input\"},\"attributes\":{},\"validateOn\":\"change\",\"validate\":{\"required\":false,\"custom\":\"\",\"customPrivate\":false,\"strictDateValidation\":false,\"multiple\":false,\"unique\":false},\"conditional\":{\"show\":null,\"when\":null,\"eq\":\"\"},\"overlay\":{\"style\":\"\",\"left\":\"\",\"top\":\"\",\"width\":\"\",\"height\":\"\"},\"allowCalculateOverride\":false,\"encrypted\":false,\"showCharCount\":false,\"showWordCount\":false,\"properties\":{},\"allowMultipleMasks\":false,\"addons\":[],\"leftIcon\":\"\",\"rightIcon\":\"\",\"id\":\"el196q\"}];\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tvar value = myScriptData;\n\t\t\t\t\t\t\t\t\t\t\tvar paymentactivate = 'false';\n\t\t\t\t\t\t\t\t\t\t\tFormio.createForm(document.getElementById('formio'), {\n\t\t\t\t\t\t\t\t\t\t\tcomponents: value\n\t\t\t\t\t\t\t\t\t\t\t}).then(function(form) {\n\t\t\t\t\t\t\t\t\t\t\t\tvar isSubmitting = false;\n\t\t\t\t\t\t\t\t\t\t\t\tif (paymentactivate === 'true') {\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar publishableKey = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar secretKey = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar stripe = Stripe(publishableKey);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar elements = stripe.elements();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar card = elements.create('card');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcard.mount('.card-element');\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar errorDiv = $(\"<div id='card-errors' role='alert'><\/div>\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('.card-element').after(errorDiv);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcard.addEventListener('change', function(event) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar displayError = document.getElementById('card-errors');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (event.error) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplayError.textContent = event.error.message;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdisplayError.textContent = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t} catch (error) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar stripe_error = error;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('.card-element').html(error);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#formio').html('Error:' + error);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ if (error instanceof IntegrationError) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \tvar stripe_error = error.message;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \tjQuery('#formio').html(error.message);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \tjQuery('.card-element').html(error.message);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \t\/\/ console.error('Stripe.js integration error:', error.message);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \t\/\/ You can display an error message to the user or take appropriate action\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ } else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \tvar stripe_error = error;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \tjQuery('#formio').html(error.message);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \tjQuery('.card-element').html(error);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \t\/\/ Handle other errors that might occur during the setup\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ \t\/\/ console.error('An unexpected error occurred:', error);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ }\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\tform.on('submit', function(submission) {\n\t\t\t\t\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar formid = 56;\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (isSubmitting) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tjQuery('#formio_res_msg').html(\"Already Submitted!\").fadeIn().delay(1000).fadeOut();\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn; \n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ isSubmitting = true;\n\t\t\t\t\t\t\t\t\t\t\t\t\tvar token = '';\n\t\t\t\t\t\t\t\t\t\t\t\t\tif (paymentactivate === 'true') {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstripe.createToken(card).then(function(result) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif (result.error) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar errorElement = document.getElementById('card-errors');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\terrorElement.textContent = result.error.message;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttoken = result.token.id; \/\/ Set the token value when it's generated\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tconsole.log(token);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ Now, make the AJAX request with the token\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmakeAjaxRequest(submission, formid, token,card,stripe,isSubmitting);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\/\/ If payment is not activated, just make the AJAX request\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmakeAjaxRequest(submission, formid, token,isSubmitting);\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t\t\t\t<\/script>\n\t\t\t\t\t\t\t\t\t\t\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"templates\/template-plugin.php","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-54","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/pages\/54","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/comments?post=54"}],"version-history":[{"count":6,"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/pages\/54\/revisions"}],"predecessor-version":[{"id":82,"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/pages\/54\/revisions\/82"}],"wp:attachment":[{"href":"https:\/\/demo.zealousweb.com\/wordpress-plugins\/smart-appointment-booking-pro\/wp-json\/wp\/v2\/media?parent=54"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}