{"id":47,"date":"2025-02-09T20:27:10","date_gmt":"2025-02-09T20:27:10","guid":{"rendered":"https:\/\/imagine.falzer.ca\/?page_id=47"},"modified":"2025-10-13T22:09:55","modified_gmt":"2025-10-14T05:09:55","slug":"become-a-member","status":"publish","type":"page","link":"https:\/\/pandosyneighbourhood.ca\/index.php\/become-a-member\/","title":{"rendered":"Become a Member"},"content":{"rendered":"\n<div>\n    <h1 style=\"text-align: center;\">Membership Signup<\/h1>\n    <p>Complete this form to begin your membership registration. After submission, you'll be directed to our secure payment page to complete your $20 membership fee.\n        Once signed up, your email address will be added to a Pandosy Neighbourhood Association newsletter mailing list.<\/p>\n    <p>Note: membership is only available to Kelowna, BC residents of the Pandosy Neighbourhood area.<\/p>\n    \n    <form id=\"membership\" method=\"POST\">\n        <p>\n            <label for=\"name\">Full Name:<\/label><BR>\n            <input type=\"text\" id=\"name\" name=\"name\" required>\n        <\/p>\n\n        <p>\n            <label for=\"email\">Email:<\/label><BR>\n            <input type=\"email\" id=\"email\" name=\"email\" required>\n        <\/p>\n\n        <p>\n            <label for=\"phone\">Phone Number:<\/label><BR>\n            <input type=\"text\" id=\"phone\" name=\"phone\" required>\n        <\/p>\n\n        <p>\n            <label for=\"address\">Street Address (With Postal Code):<\/label><BR>\n            <input type=\"text\" class=\"mobiletextfield\" id=\"address\" name=\"address\" required>\n        <\/p>\n\n        <p>\n            <input type=\"button\" id=\"submit-button\" value=\"Continue to Payment ($20)\">\n        <\/p>\n    <\/form>\n<\/div>\n\n<script>\n    let APIsubmitForm = function() {\n        \/\/ check if all fields are filled\n        \/\/ get form data\n        let formData = new FormData(document.getElementById('membership'));\n        formData.append('action', 'submit_membership_form');\n        fetch('\/api.php', {\n            method: 'POST',\n            body: formData\n        })\n        .then(response => {\n            if (!response.ok) {\n                alert(\"An unknown error occurred. Please try again later.\");\n            }\n            return response.json();\n        })\n        .then(data => {\n            console.log(data);\n            if(data) {\n                if (data.status === 'success') {\n                    \/\/ go to url returned in data (url should point to payment page)\n                    window.location.href = data.url;\n                } else if(data.message) {\n                    alert(data.message);\n                } else {\n                    alert(\"An unknown error occurred. Please try again later.\");\n                }\n            } else {\n                alert(\"An unknown error occurred. Please try again later.\");\n            }\n        });\n    };\n    document.getElementById('submit-button').addEventListener('click', APIsubmitForm);\n\n<\/script>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-47","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/pages\/47","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/comments?post=47"}],"version-history":[{"count":3,"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/pages\/47\/revisions"}],"predecessor-version":[{"id":538,"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/pages\/47\/revisions\/538"}],"wp:attachment":[{"href":"https:\/\/pandosyneighbourhood.ca\/index.php\/wp-json\/wp\/v2\/media?parent=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}