{"id":88,"date":"2012-02-27T12:05:43","date_gmt":"2012-02-27T12:05:43","guid":{"rendered":"http:\/\/www.hlcounseling.com\/wordpress\/?page_id=88"},"modified":"2022-07-02T07:18:32","modified_gmt":"2022-07-02T13:18:32","slug":"pay-online","status":"publish","type":"page","link":"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/","title":{"rendered":"Pay Online"},"content":{"rendered":"\n<div id=\"smart-button-container\">\n    <div style=\"text-align: center\"><label for=\"description\">Quantity <\/label><input type=\"text\" name=\"descriptionInput\" id=\"description\" maxlength=\"127\" value=\"\"><\/div>\n      <p id=\"descriptionError\" style=\"visibility: hidden; color:red; text-align: center;\">Please enter a description<\/p>\n    <div style=\"text-align: center\"><label for=\"amount\">Pay Now <\/label><input name=\"amountInput\" type=\"number\" id=\"amount\" value=\"\" ><span> USD<\/span><\/div>\n      <p id=\"priceLabelError\" style=\"visibility: hidden; color:red; text-align: center;\">Please enter a price<\/p>\n    <div id=\"invoiceidDiv\" style=\"text-align: center; display: none;\"><label for=\"invoiceid\"> <\/label><input name=\"invoiceid\" maxlength=\"127\" type=\"text\" id=\"invoiceid\" value=\"\" ><\/div>\n      <p id=\"invoiceidError\" style=\"visibility: hidden; color:red; text-align: center;\">Please enter an Invoice ID<\/p>\n    <div style=\"text-align: center; margin-top: 0.625rem;\" id=\"paypal-button-container\"><\/div>\n  <\/div>\n  <script src=\"https:\/\/www.paypal.com\/sdk\/js?client-id=sb&#038;enable-funding=venmo&#038;currency=USD\" data-sdk-integration-source=\"button-factory\"><\/script>\n  <script>\n  function initPayPalButton() {\n    var description = document.querySelector('#smart-button-container #description');\n    var amount = document.querySelector('#smart-button-container #amount');\n    var descriptionError = document.querySelector('#smart-button-container #descriptionError');\n    var priceError = document.querySelector('#smart-button-container #priceLabelError');\n    var invoiceid = document.querySelector('#smart-button-container #invoiceid');\n    var invoiceidError = document.querySelector('#smart-button-container #invoiceidError');\n    var invoiceidDiv = document.querySelector('#smart-button-container #invoiceidDiv');\n\n    var elArr = [description, amount];\n\n    if (invoiceidDiv.firstChild.innerHTML.length > 1) {\n      invoiceidDiv.style.display = \"block\";\n    }\n\n    var purchase_units = [];\n    purchase_units[0] = {};\n    purchase_units[0].amount = {};\n\n    function validate(event) {\n      return event.value.length > 0;\n    }\n\n    paypal.Buttons({\n      style: {\n        color: 'gold',\n        shape: 'rect',\n        label: 'paypal',\n        layout: 'vertical',\n        \n      },\n\n      onInit: function (data, actions) {\n        actions.disable();\n\n        if(invoiceidDiv.style.display === \"block\") {\n          elArr.push(invoiceid);\n        }\n\n        elArr.forEach(function (item) {\n          item.addEventListener('keyup', function (event) {\n            var result = elArr.every(validate);\n            if (result) {\n              actions.enable();\n            } else {\n              actions.disable();\n            }\n          });\n        });\n      },\n\n      onClick: function () {\n        if (description.value.length < 1) {\n          descriptionError.style.visibility = \"visible\";\n        } else {\n          descriptionError.style.visibility = \"hidden\";\n        }\n\n        if (amount.value.length < 1) {\n          priceError.style.visibility = \"visible\";\n        } else {\n          priceError.style.visibility = \"hidden\";\n        }\n\n        if (invoiceid.value.length < 1 &#038;&#038; invoiceidDiv.style.display === \"block\") {\n          invoiceidError.style.visibility = \"visible\";\n        } else {\n          invoiceidError.style.visibility = \"hidden\";\n        }\n\n        purchase_units[0].description = description.value;\n        purchase_units[0].amount.value = amount.value;\n\n        if(invoiceid.value !== '') {\n          purchase_units[0].invoice_id = invoiceid.value;\n        }\n      },\n\n      createOrder: function (data, actions) {\n        return actions.order.create({\n          purchase_units: purchase_units,\n        });\n      },\n\n      onApprove: function (data, actions) {\n        return actions.order.capture().then(function (orderData) {\n\n          \/\/ Full available details\n          console.log('Capture result', orderData, JSON.stringify(orderData, null, 2));\n\n          \/\/ Show a success message within this page, e.g.\n          const element = document.getElementById('paypal-button-container');\n          element.innerHTML = '';\n          element.innerHTML = '<h3>Thank you for your payment!<\/h3>';\n\n          \/\/ Or go to another URL:  actions.redirect('thank_you.html');\n          \n        });\n      },\n\n      onError: function (err) {\n        console.log(err);\n      }\n    }).render('#paypal-button-container');\n  }\n  initPayPalButton();\n  <\/script>\n","protected":false},"excerpt":{"rendered":"<p>Quantity <\/p>\n<p id=\"descriptionError\" style=\"visibility: hidden; color:red; text-align: center;\">Please enter a description<\/p>\n<p> Pay Now USD <\/p>\n<p id=\"priceLabelError\" style=\"visibility: hidden; color:red; text-align: center;\">Please enter a price<\/p>\n<p id=\"invoiceidError\" style=\"visibility: hidden; color:red; text-align: center;\">Please enter an Invoice ID<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"open","template":"page.base.php","meta":{"footnotes":""},"class_list":["post-88","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Personal and Professional Development Coaching and Psychotherapy in Denver<\/title>\n<meta name=\"description\" content=\"Psychotherapy and counseling in Denver for individuals and couples having marriage, relationship, and emotional struggles such as depression, anger, or anxiety.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/\",\"url\":\"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/\",\"name\":\"Personal and Professional Development Coaching and Psychotherapy in Denver\",\"isPartOf\":{\"@id\":\"https:\/\/www.hlcounseling.com\/wordpress\/#website\"},\"datePublished\":\"2012-02-27T12:05:43+00:00\",\"dateModified\":\"2022-07-02T13:18:32+00:00\",\"description\":\"Psychotherapy and counseling in Denver for individuals and couples having marriage, relationship, and emotional struggles such as depression, anger, or anxiety.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.hlcounseling.com\/wordpress\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Pay Online\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.hlcounseling.com\/wordpress\/#website\",\"url\":\"https:\/\/www.hlcounseling.com\/wordpress\/\",\"name\":\"\",\"description\":\"Heather Leavesley, MA, MA, IFS Certified Practitioner\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.hlcounseling.com\/wordpress\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Personal and Professional Development Coaching and Psychotherapy in Denver","description":"Psychotherapy and counseling in Denver for individuals and couples having marriage, relationship, and emotional struggles such as depression, anger, or anxiety.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/","url":"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/","name":"Personal and Professional Development Coaching and Psychotherapy in Denver","isPartOf":{"@id":"https:\/\/www.hlcounseling.com\/wordpress\/#website"},"datePublished":"2012-02-27T12:05:43+00:00","dateModified":"2022-07-02T13:18:32+00:00","description":"Psychotherapy and counseling in Denver for individuals and couples having marriage, relationship, and emotional struggles such as depression, anger, or anxiety.","breadcrumb":{"@id":"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.hlcounseling.com\/wordpress\/pay-online\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.hlcounseling.com\/wordpress\/"},{"@type":"ListItem","position":2,"name":"Pay Online"}]},{"@type":"WebSite","@id":"https:\/\/www.hlcounseling.com\/wordpress\/#website","url":"https:\/\/www.hlcounseling.com\/wordpress\/","name":"","description":"Heather Leavesley, MA, MA, IFS Certified Practitioner","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.hlcounseling.com\/wordpress\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/pages\/88","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/comments?post=88"}],"version-history":[{"count":24,"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/pages\/88\/revisions"}],"predecessor-version":[{"id":1173,"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/pages\/88\/revisions\/1173"}],"wp:attachment":[{"href":"https:\/\/www.hlcounseling.com\/wordpress\/wp-json\/wp\/v2\/media?parent=88"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}