{"id":7043,"date":"2022-05-17T15:42:32","date_gmt":"2022-05-17T20:42:32","guid":{"rendered":"https:\/\/emendedhearts.com\/?page_id=7043"},"modified":"2025-04-25T15:40:34","modified_gmt":"2025-04-25T20:40:34","slug":"join","status":"publish","type":"page","link":"https:\/\/emendedhearts.com\/hi\/join\/","title":{"rendered":"\u091c\u094b\u0921\u093c\u0928\u093e"},"content":{"rendered":"<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"2560\" height=\"306\" src=\"https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-scaled.png\" alt=\"\" class=\"wp-image-14110\" style=\"width:696px;height:auto\" srcset=\"https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-scaled.png 2560w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-300x36.png 300w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-1024x122.png 1024w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-768x92.png 768w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-1536x184.png 1536w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-2048x245.png 2048w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-18x2.png 18w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-1440x172.png 1440w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-800x96.png 800w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-550x66.png 550w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-1920x229.png 1920w, https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Author-Brand-Name-1-1320x158.png 1320w\" sizes=\"auto, (max-width: 2560px) 100vw, 2560px\" \/><\/figure>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-c13d9a20\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-c13d9a20\"><strong> <o-anim-typing>\u092e\u0948\u0902<\/o-anim-typing>NITIALS<\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-b9b1ef43\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-b9b1ef43\"><s>$49.99<\/s><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-96ad65e6\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-96ad65e6 o-typing-slower o-typing-delay-500ms\"><strong>$9.99<\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-8b100ea6\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-8b100ea6\">\u092a\u094d\u0930\u0924\u093f \u092e\u0939\u0940\u0928\u0947<\/h2>\n\n\n<p><center><div class=\"swpm-payment-button\">    <div id=\"swpm-button-wrapper-13463\" class=\"swpm-button-wrapper swpm-paypal-subscription-button-wrapper\">\n\n    <!-- PayPal button container where the button will be rendered -->\n    <div id=\"swpm_paypal_button_0\" style=\"width: 300px;\"><\/div>\n    <!-- Some additiona hidden input fields -->\n    <input type=\"hidden\" id=\"swpm_paypal_button_0-custom-field\" name=\"custom\" value=\"subsc_ref=2&amp;user_ip=216.73.216.107\">\n\n    <script type=\"text\/javascript\">\n        document.addEventListener( \"swpm_paypal_sdk_subscriptions_loaded\", function() { \n            \/\/Anything that goes here will only be executed after the PayPal SDK is loaded.\n\n            const paypalSubButtonsComponent = swpm_paypal_subscriptions.Buttons({\n                \/\/ optional styling for buttons\n                \/\/ https:\/\/developer.paypal.com\/docs\/checkout\/standard\/customize\/buttons-style-guide\/\n                style: {\n                    color: 'gold',\n                    shape: 'rect',\n                    height: 45,\n                    label: 'subscribe',\n                    layout: 'vertical',\n                },\n    \n                \/\/ Handle the createSubscription call\n                createSubscription: async function(data, actions) {\n                    \/\/ console.log('createSubscription call triggered. Data: ' + JSON.stringify(data));\n\n                    \/\/We will send ajax request that will create the subscription from the server side using PayPal API.\n                    let pp_sub_bn_data = {};\n                    pp_sub_bn_data.button_id = '13463';\n                    pp_sub_bn_data.on_page_button_id = 'swpm_paypal_button_0';\n                    pp_sub_bn_data.item_name = 'Emended Hearts Subscription ($9.99) New API';\n                    let post_data = 'action=swpm_pp_create_subscription&data=' + JSON.stringify(pp_sub_bn_data) + '&_wpnonce=80bfe7d622';\n                    try {\n                        \/\/ Using fetch for AJAX request. This is supported in all modern browsers.\n                        const response = await fetch(\"https:\/\/emendedhearts.com\/wp-admin\/admin-ajax.php\", {\n                            method: \"post\",\n                            headers: {\n                                'Content-Type': 'application\/x-www-form-urlencoded'\n                            },\n                            body: post_data\n                        });\n\n                        const response_data = await response.json();\n\n                        if (response_data.subscription_id) {\n                            console.log('Create-subscription API call to PayPal completed successfully.');\n                            \/\/If we need to see the details, uncomment the following line.\n                            \/\/console.log('Order data: ' + JSON.stringify(response_data.sub_data));\n\n                            \/\/Return the subscription ID.\n                            return response_data.subscription_id;\n                        } else {\n                            const error_message = JSON.stringify(response_data);\n                            console.error('Error occurred during the create-subscription API call to PayPal. ' + error_message);\n                            throw new Error(error_message);\n                        }\n                    } catch (error) {\n                        console.error(error);\n                        alert('Could not initiate PayPal subscription...\\n\\n' + JSON.stringify(error));\n                    }\n                },\n    \n                \/\/ Notify the buyer that the subscription is successful\n                onApprove: function(data, actions) {\n                    console.log('Successfully created a subscription.');\n                    \/\/console.log(JSON.stringify(data));\n\n                    \/\/Show the spinner while we process this transaction.\n                    const pp_button_container = document.getElementById('swpm_paypal_button_0');\n                    const pp_button_container_wrapper = document.getElementById('swpm-button-wrapper-13463');\n                    const pp_button_spinner_container = pp_button_container_wrapper.querySelector('.swpm-pp-button-spinner-container');\n                    pp_button_container.style.display = 'none'; \/\/Hide the buttons\n                    pp_button_spinner_container.style.display = 'inline-block'; \/\/Show the spinner.\n\n                    \/\/Get the subscription details and send AJAX request to process the transaction.\n                    actions.subscription.get().then( async function( txn_data ) {\n                        \/\/console.log( 'Subscription details: ' + JSON.stringify( txn_data ) );\n\n                        \/\/Ajax request to process the transaction. This will process it similar to how an IPN request is handled.\n                        const custom = document.getElementById('swpm_paypal_button_0-custom-field').value;\n                        data.custom_field = custom;\n                        data.button_id = '13463';\n                        data.on_page_button_id = 'swpm_paypal_button_0';\n                        data.item_name = 'Emended Hearts Subscription ($9.99) New API';\n\n                        const post_data = new URLSearchParams({\n                            action: 'swpm_onapprove_process_subscription',\n                            data: JSON.stringify(data),\n                            txn_data: JSON.stringify(txn_data),\n                            _wpnonce: '80bfe7d622',\n                        }).toString();\n\n                        try {\n                            const requestUrl = \"https:\/\/emendedhearts.com\/wp-admin\/admin-ajax.php\";\n                            const resp = await fetch( requestUrl, {\n                                method: \"post\",\n                                headers: {\n                                    'Content-Type': 'application\/x-www-form-urlencoded'\n                                },\n                                body: post_data\n                            });\n\n                            const response = await resp.json();\n\n                            \/\/console.log( 'Response from the server: ' + JSON.stringify( response ) );\n                            if ( response.success ) {\n\n                                \/\/Redirect to the Thank you page or Registration page URL if it is set.\n                                const return_url = response.redirect_url || '';\n                                if( return_url ){\n                                    \/\/redirect to the URL.\n                                    console.log('Redirecting to the Thank you page URL: ' + return_url);\n                                    window.location.href = return_url;\n                                    return;\n                                }\n\n                                \/\/No return URL is set. Just show a success message.\n                                \/\/Important Note: any alert message will block the normal PayPal popup window flow. So we want to show the message on the page instead of using alert.\n                                txn_success_msg = 'Transaction completed successfully!';\n                                const swpm_btn_wrapper_div = document.getElementById('swpm-button-wrapper-13463');\n                                if (swpm_btn_wrapper_div) {\n                                    \/\/ Remove any previous message if it exists\n                                    const old_msg_div = swpm_btn_wrapper_div.querySelector('.swpm-ppcp-txn-success-message');\n                                    if (old_msg_div) old_msg_div.remove();\n\n                                    \/\/ Create new message div\n                                    const new_msg_div = document.createElement('div');\n                                    new_msg_div.className = 'swpm-ppcp-txn-success-message';\n                                    new_msg_div.textContent = txn_success_msg;\n\n                                    \/\/Insert the message div before the button.\n                                    const firstChild = swpm_btn_wrapper_div.firstChild;\n                                    swpm_btn_wrapper_div.insertBefore(new_msg_div, firstChild);\n                                }\n\n                                \/\/ Trigger a event on subscription complete \n                                document.dispatchEvent(new Event('swpm_paypal_subscriptions_complete'));\n                        \n                            } else {\n                                \/\/Error response from the AJAX IPN hanler. Throw error.\n                                throw new Error(response.err_msg);\n                            }\n\n                            \/\/Return the button and the spinner back to their orignal display state.\n                            pp_button_container.style.display = 'block'; \/\/ Show the buttons\n                            pp_button_spinner_container.style.display = 'none'; \/\/ Hide the spinner\n\n                        } catch (error) {\n                            \/\/ Show the error message.\n                            alert(error.message);\n                            console.error( error.message );\n                        }\n                    });\n                },\n    \n                \/\/ handle unrecoverable errors\n                onError: function(err) {\n                    console.error('An error prevented the user from checking out with PayPal. ' + JSON.stringify(err));\n                    alert( 'Error occurred during PayPal checkout process.\\n\\n' + JSON.stringify(err) );\n                }\n            });\n    \n            paypalSubButtonsComponent\n                .render('#swpm_paypal_button_0')\n                .catch((err) => {\n                    console.error('PayPal Buttons failed to render');\n                });\n        });\n    <\/script>\n    <style>\n        @keyframes swpm-pp-button-spinner {\n            to {transform: rotate(360deg);}\n        }\n        .swpm-pp-button-spinner {\n            margin: 0 auto;\n            text-indent: -9999px;\n            vertical-align: middle;\n            box-sizing: border-box;\n            position: relative;\n            width: 60px;\n            height: 60px;\n            border-radius: 50%;\n            border: 5px solid #ccc;\n            border-top-color: #0070ba;\n            animation: swpm-pp-button-spinner .6s linear infinite;\n        }\n        .swpm-pp-button-spinner-container {\n            width: 100%;\n            text-align: center;\n            margin-top:10px;\n            display: none;\n        }\n    <\/style>\n    <div class=\"swpm-pp-button-spinner-container\">\n        <div class=\"swpm-pp-button-spinner\"><\/div>\n    <\/div>\n    <\/div><!-- end of .swpm-button-wrapper -->\n    <\/div><\/center><\/p>\n\n\n\n<h4 id=\"wp-block-themeisle-blocks-advanced-heading-6185b55f\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-6185b55f\"><o-anim-typing>for what you spend on<\/o-anim-typing><\/h4>\n\n\n\n<h4 id=\"wp-block-themeisle-blocks-advanced-heading-d2eb18cd\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-d2eb18cd\"><em>Gourmet Coffee\/Daily<\/em> \u2615\ufe0f<\/h4>\n\n\n\n<h4 id=\"wp-block-themeisle-blocks-advanced-heading-2b819e6c\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-2b819e6c\"><em>The Swear Jar\/Weekly<\/em> \ud83e\udd11<\/h4>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-2797d3d8\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-2797d3d8\">Become a member.<strong> Get full access.<\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-17f73b86\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-17f73b86 animated fadeInTopLeft slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\">\u2764\ufe0f\u200d\ud83d\udd25<\/span><em> Racy Romance<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-ebabedb1\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-ebabedb1 animated fadeInDownBig slow has-light-bg\"><strong>\ud83d\ude3b <em>Sizzling Smut<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-df4c181e\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-df4c181e animated fadeInBottomLeft slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\"><span class=\"tadv-color\" style=\"color:#cf2e2e\"><span class=\"tadv-color\" style=\"color:#cf2e2e\">\ud83d\udc9f<\/span><\/span><\/span><em> <\/em><em>Printable<\/em><\/strong> <strong><em>Pleasures<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-bed3d9cc\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-bed3d9cc animated bounceInUp slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\">\ud83e\udd70<\/span><em> Multimedia Mix<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-2a525492\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-2a525492 animated backInDown slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\">\ud83d\ude0d<\/span><em> Vicarious Video<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-122cf614\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-122cf614 animated fadeInBottomLeft slow has-light-bg\">\ud83d\udc97 <strong><em>Pr<\/em><\/strong><em><strong>ov<\/strong><\/em><em><strong>ocative<\/strong><\/em> <strong><em>Poems<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-1b6ab133\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-1b6ab133 animated heartBeat slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\">\ud83d\udc98<\/span><em> Alluring Art<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-175fe6f4\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-175fe6f4 animated fadeInTopLeft slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\">\ud83d\udc93<\/span><em> <\/em><em>Amorous Audio<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-6eab6f23\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-6eab6f23 animated jello slow has-light-bg\">\ud83d\udc8c <strong><em>Love + Lust Letters<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-f7bd20d1\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-f7bd20d1 animated bounceInUp slow has-light-bg\"><strong><span class=\"tadv-color\" style=\"color:#cf2e2e\"><span class=\"tadv-color\" style=\"color:#cf2e2e\"><span class=\"tadv-color\" style=\"color:#cf2e2e\">\ud83d\udc95<\/span><\/span><\/span><\/strong> <strong><em>Power Play<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-5c69b379\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-5c69b379 animated rubberBand slow has-light-bg\">\ud83d\udc9d<span class=\"tadv-color\" style=\"color:#cf2e2e\"> <\/span><strong><em>\u092e\u091c\u0947\u0926\u093e\u0930-\u0938\u094d\u0935\u093e\u0926\u093f\u0937\u094d\u091f \u0935\u093f\u0936\u0947\u0937\u0924\u093e\u090f\u0902<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-dfe5f4eb\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-dfe5f4eb animated heartBeat slow has-light-bg\"><strong><span style=\"color:#cf2e2e\" class=\"tadv-color\">\ud83d\udc9e<\/span><em> <\/em><em>\u0906\u0915\u0930\u094d\u0937\u0915 \u0938\u092e\u0941\u0926\u093e\u092f<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-5977b496\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-5977b496 animated jello slow has-light-bg\">\ud83d\ude18 <strong><em>Lots of &#8220;Love&#8221; Languages<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-aabb411e\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-aabb411e animated swing slow has-light-bg\"><span style=\"color:#cf2e2e\" class=\"tadv-color\"><strong>\ud83d\udc96<\/strong><\/span><strong><em> <\/em><\/strong><strong><em>\u0915\u094b\u0908 \u0915\u0937\u094d\u091f\u092a\u094d\u0930\u0926 \u0935\u093f\u091c\u094d\u091e\u093e\u092a\u0928 \u0928\u0939\u0940\u0902<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-f4038185\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-f4038185\"> <strong>All the Romance<\/strong>. One low price.<\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-22f78c6a\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-22f78c6a\"><em>Go ahead. <strong>Make the Initial move<\/strong>.<\/em><\/h2>\n\n\n<p><center><div class=\"swpm-payment-button\">    <div id=\"swpm-button-wrapper-13463\" class=\"swpm-button-wrapper swpm-paypal-subscription-button-wrapper\">\n\n    <!-- PayPal button container where the button will be rendered -->\n    <div id=\"swpm_paypal_button_1\" style=\"width: 300px;\"><\/div>\n    <!-- Some additiona hidden input fields -->\n    <input type=\"hidden\" id=\"swpm_paypal_button_1-custom-field\" name=\"custom\" value=\"subsc_ref=2&amp;user_ip=216.73.216.107\">\n\n    <script type=\"text\/javascript\">\n        document.addEventListener( \"swpm_paypal_sdk_subscriptions_loaded\", function() { \n            \/\/Anything that goes here will only be executed after the PayPal SDK is loaded.\n\n            const paypalSubButtonsComponent = swpm_paypal_subscriptions.Buttons({\n                \/\/ optional styling for buttons\n                \/\/ https:\/\/developer.paypal.com\/docs\/checkout\/standard\/customize\/buttons-style-guide\/\n                style: {\n                    color: 'gold',\n                    shape: 'rect',\n                    height: 45,\n                    label: 'subscribe',\n                    layout: 'vertical',\n                },\n    \n                \/\/ Handle the createSubscription call\n                createSubscription: async function(data, actions) {\n                    \/\/ console.log('createSubscription call triggered. Data: ' + JSON.stringify(data));\n\n                    \/\/We will send ajax request that will create the subscription from the server side using PayPal API.\n                    let pp_sub_bn_data = {};\n                    pp_sub_bn_data.button_id = '13463';\n                    pp_sub_bn_data.on_page_button_id = 'swpm_paypal_button_1';\n                    pp_sub_bn_data.item_name = 'Emended Hearts Subscription ($9.99) New API';\n                    let post_data = 'action=swpm_pp_create_subscription&data=' + JSON.stringify(pp_sub_bn_data) + '&_wpnonce=e86a68475b';\n                    try {\n                        \/\/ Using fetch for AJAX request. This is supported in all modern browsers.\n                        const response = await fetch(\"https:\/\/emendedhearts.com\/wp-admin\/admin-ajax.php\", {\n                            method: \"post\",\n                            headers: {\n                                'Content-Type': 'application\/x-www-form-urlencoded'\n                            },\n                            body: post_data\n                        });\n\n                        const response_data = await response.json();\n\n                        if (response_data.subscription_id) {\n                            console.log('Create-subscription API call to PayPal completed successfully.');\n                            \/\/If we need to see the details, uncomment the following line.\n                            \/\/console.log('Order data: ' + JSON.stringify(response_data.sub_data));\n\n                            \/\/Return the subscription ID.\n                            return response_data.subscription_id;\n                        } else {\n                            const error_message = JSON.stringify(response_data);\n                            console.error('Error occurred during the create-subscription API call to PayPal. ' + error_message);\n                            throw new Error(error_message);\n                        }\n                    } catch (error) {\n                        console.error(error);\n                        alert('Could not initiate PayPal subscription...\\n\\n' + JSON.stringify(error));\n                    }\n                },\n    \n                \/\/ Notify the buyer that the subscription is successful\n                onApprove: function(data, actions) {\n                    console.log('Successfully created a subscription.');\n                    \/\/console.log(JSON.stringify(data));\n\n                    \/\/Show the spinner while we process this transaction.\n                    const pp_button_container = document.getElementById('swpm_paypal_button_1');\n                    const pp_button_container_wrapper = document.getElementById('swpm-button-wrapper-13463');\n                    const pp_button_spinner_container = pp_button_container_wrapper.querySelector('.swpm-pp-button-spinner-container');\n                    pp_button_container.style.display = 'none'; \/\/Hide the buttons\n                    pp_button_spinner_container.style.display = 'inline-block'; \/\/Show the spinner.\n\n                    \/\/Get the subscription details and send AJAX request to process the transaction.\n                    actions.subscription.get().then( async function( txn_data ) {\n                        \/\/console.log( 'Subscription details: ' + JSON.stringify( txn_data ) );\n\n                        \/\/Ajax request to process the transaction. This will process it similar to how an IPN request is handled.\n                        const custom = document.getElementById('swpm_paypal_button_1-custom-field').value;\n                        data.custom_field = custom;\n                        data.button_id = '13463';\n                        data.on_page_button_id = 'swpm_paypal_button_1';\n                        data.item_name = 'Emended Hearts Subscription ($9.99) New API';\n\n                        const post_data = new URLSearchParams({\n                            action: 'swpm_onapprove_process_subscription',\n                            data: JSON.stringify(data),\n                            txn_data: JSON.stringify(txn_data),\n                            _wpnonce: 'e86a68475b',\n                        }).toString();\n\n                        try {\n                            const requestUrl = \"https:\/\/emendedhearts.com\/wp-admin\/admin-ajax.php\";\n                            const resp = await fetch( requestUrl, {\n                                method: \"post\",\n                                headers: {\n                                    'Content-Type': 'application\/x-www-form-urlencoded'\n                                },\n                                body: post_data\n                            });\n\n                            const response = await resp.json();\n\n                            \/\/console.log( 'Response from the server: ' + JSON.stringify( response ) );\n                            if ( response.success ) {\n\n                                \/\/Redirect to the Thank you page or Registration page URL if it is set.\n                                const return_url = response.redirect_url || '';\n                                if( return_url ){\n                                    \/\/redirect to the URL.\n                                    console.log('Redirecting to the Thank you page URL: ' + return_url);\n                                    window.location.href = return_url;\n                                    return;\n                                }\n\n                                \/\/No return URL is set. Just show a success message.\n                                \/\/Important Note: any alert message will block the normal PayPal popup window flow. So we want to show the message on the page instead of using alert.\n                                txn_success_msg = 'Transaction completed successfully!';\n                                const swpm_btn_wrapper_div = document.getElementById('swpm-button-wrapper-13463');\n                                if (swpm_btn_wrapper_div) {\n                                    \/\/ Remove any previous message if it exists\n                                    const old_msg_div = swpm_btn_wrapper_div.querySelector('.swpm-ppcp-txn-success-message');\n                                    if (old_msg_div) old_msg_div.remove();\n\n                                    \/\/ Create new message div\n                                    const new_msg_div = document.createElement('div');\n                                    new_msg_div.className = 'swpm-ppcp-txn-success-message';\n                                    new_msg_div.textContent = txn_success_msg;\n\n                                    \/\/Insert the message div before the button.\n                                    const firstChild = swpm_btn_wrapper_div.firstChild;\n                                    swpm_btn_wrapper_div.insertBefore(new_msg_div, firstChild);\n                                }\n\n                                \/\/ Trigger a event on subscription complete \n                                document.dispatchEvent(new Event('swpm_paypal_subscriptions_complete'));\n                        \n                            } else {\n                                \/\/Error response from the AJAX IPN hanler. Throw error.\n                                throw new Error(response.err_msg);\n                            }\n\n                            \/\/Return the button and the spinner back to their orignal display state.\n                            pp_button_container.style.display = 'block'; \/\/ Show the buttons\n                            pp_button_spinner_container.style.display = 'none'; \/\/ Hide the spinner\n\n                        } catch (error) {\n                            \/\/ Show the error message.\n                            alert(error.message);\n                            console.error( error.message );\n                        }\n                    });\n                },\n    \n                \/\/ handle unrecoverable errors\n                onError: function(err) {\n                    console.error('An error prevented the user from checking out with PayPal. ' + JSON.stringify(err));\n                    alert( 'Error occurred during PayPal checkout process.\\n\\n' + JSON.stringify(err) );\n                }\n            });\n    \n            paypalSubButtonsComponent\n                .render('#swpm_paypal_button_1')\n                .catch((err) => {\n                    console.error('PayPal Buttons failed to render');\n                });\n        });\n    <\/script>\n    <style>\n        @keyframes swpm-pp-button-spinner {\n            to {transform: rotate(360deg);}\n        }\n        .swpm-pp-button-spinner {\n            margin: 0 auto;\n            text-indent: -9999px;\n            vertical-align: middle;\n            box-sizing: border-box;\n            position: relative;\n            width: 60px;\n            height: 60px;\n            border-radius: 50%;\n            border: 5px solid #ccc;\n            border-top-color: #0070ba;\n            animation: swpm-pp-button-spinner .6s linear infinite;\n        }\n        .swpm-pp-button-spinner-container {\n            width: 100%;\n            text-align: center;\n            margin-top:10px;\n            display: none;\n        }\n    <\/style>\n    <div class=\"swpm-pp-button-spinner-container\">\n        <div class=\"swpm-pp-button-spinner\"><\/div>\n    <\/div>\n    <\/div><!-- end of .swpm-button-wrapper -->\n    <\/div><\/center><\/p>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-92eae55f\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-92eae55f\"><em><strong>1 Million+ Words Worth of Steamy, Exclusive Content<\/strong><\/em><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-53cf5ba6\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-53cf5ba6\"><em><strong>2000+ Initial Heartbeats<\/strong><\/em><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-849a2933\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-849a2933\"><strong><em>1000+ Original Printable<\/em> <em>Art, Games, and More<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-7edb9cae\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-7edb9cae\"><em><strong>100+ Hours of Eargasmic Audio stories<\/strong><\/em><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-94df847f\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-94df847f\"><strong><em>Infinite \u221e<\/em> <em>Loops of Your Racing Heart<\/em><\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-a5e93229\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-a5e93229\"><em><strong>365 Days of Pure Obsession<\/strong><\/em><\/h2>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"500\" src=\"https:\/\/emendedhearts.com\/wp-content\/uploads\/2025\/04\/Emended-Hearts-Avatars-2.gif\" alt=\"\" class=\"wp-image-14163\" style=\"width:288px;height:auto\"\/><\/figure>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-79313cff\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-79313cff\"><strong>One click, one heart, all the feels.<\/strong><\/h2>\n\n\n\n<h2 id=\"wp-block-themeisle-blocks-advanced-heading-b38658f5\" class=\"wp-block-themeisle-blocks-advanced-heading wp-block-themeisle-blocks-advanced-heading-b38658f5\"><strong>Join the Obsession<\/strong><\/h2>\n\n\n<p><center><div class=\"swpm-payment-button\">    <div id=\"swpm-button-wrapper-13463\" class=\"swpm-button-wrapper swpm-paypal-subscription-button-wrapper\">\n\n    <!-- PayPal button container where the button will be rendered -->\n    <div id=\"swpm_paypal_button_2\" style=\"width: 300px;\"><\/div>\n    <!-- Some additiona hidden input fields -->\n    <input type=\"hidden\" id=\"swpm_paypal_button_2-custom-field\" name=\"custom\" value=\"subsc_ref=2&amp;user_ip=216.73.216.107\">\n\n    <script type=\"text\/javascript\">\n        document.addEventListener( \"swpm_paypal_sdk_subscriptions_loaded\", function() { \n            \/\/Anything that goes here will only be executed after the PayPal SDK is loaded.\n\n            const paypalSubButtonsComponent = swpm_paypal_subscriptions.Buttons({\n                \/\/ optional styling for buttons\n                \/\/ https:\/\/developer.paypal.com\/docs\/checkout\/standard\/customize\/buttons-style-guide\/\n                style: {\n                    color: 'gold',\n                    shape: 'rect',\n                    height: 45,\n                    label: 'subscribe',\n                    layout: 'vertical',\n                },\n    \n                \/\/ Handle the createSubscription call\n                createSubscription: async function(data, actions) {\n                    \/\/ console.log('createSubscription call triggered. Data: ' + JSON.stringify(data));\n\n                    \/\/We will send ajax request that will create the subscription from the server side using PayPal API.\n                    let pp_sub_bn_data = {};\n                    pp_sub_bn_data.button_id = '13463';\n                    pp_sub_bn_data.on_page_button_id = 'swpm_paypal_button_2';\n                    pp_sub_bn_data.item_name = 'Emended Hearts Subscription ($9.99) New API';\n                    let post_data = 'action=swpm_pp_create_subscription&data=' + JSON.stringify(pp_sub_bn_data) + '&_wpnonce=6171179564';\n                    try {\n                        \/\/ Using fetch for AJAX request. This is supported in all modern browsers.\n                        const response = await fetch(\"https:\/\/emendedhearts.com\/wp-admin\/admin-ajax.php\", {\n                            method: \"post\",\n                            headers: {\n                                'Content-Type': 'application\/x-www-form-urlencoded'\n                            },\n                            body: post_data\n                        });\n\n                        const response_data = await response.json();\n\n                        if (response_data.subscription_id) {\n                            console.log('Create-subscription API call to PayPal completed successfully.');\n                            \/\/If we need to see the details, uncomment the following line.\n                            \/\/console.log('Order data: ' + JSON.stringify(response_data.sub_data));\n\n                            \/\/Return the subscription ID.\n                            return response_data.subscription_id;\n                        } else {\n                            const error_message = JSON.stringify(response_data);\n                            console.error('Error occurred during the create-subscription API call to PayPal. ' + error_message);\n                            throw new Error(error_message);\n                        }\n                    } catch (error) {\n                        console.error(error);\n                        alert('Could not initiate PayPal subscription...\\n\\n' + JSON.stringify(error));\n                    }\n                },\n    \n                \/\/ Notify the buyer that the subscription is successful\n                onApprove: function(data, actions) {\n                    console.log('Successfully created a subscription.');\n                    \/\/console.log(JSON.stringify(data));\n\n                    \/\/Show the spinner while we process this transaction.\n                    const pp_button_container = document.getElementById('swpm_paypal_button_2');\n                    const pp_button_container_wrapper = document.getElementById('swpm-button-wrapper-13463');\n                    const pp_button_spinner_container = pp_button_container_wrapper.querySelector('.swpm-pp-button-spinner-container');\n                    pp_button_container.style.display = 'none'; \/\/Hide the buttons\n                    pp_button_spinner_container.style.display = 'inline-block'; \/\/Show the spinner.\n\n                    \/\/Get the subscription details and send AJAX request to process the transaction.\n                    actions.subscription.get().then( async function( txn_data ) {\n                        \/\/console.log( 'Subscription details: ' + JSON.stringify( txn_data ) );\n\n                        \/\/Ajax request to process the transaction. This will process it similar to how an IPN request is handled.\n                        const custom = document.getElementById('swpm_paypal_button_2-custom-field').value;\n                        data.custom_field = custom;\n                        data.button_id = '13463';\n                        data.on_page_button_id = 'swpm_paypal_button_2';\n                        data.item_name = 'Emended Hearts Subscription ($9.99) New API';\n\n                        const post_data = new URLSearchParams({\n                            action: 'swpm_onapprove_process_subscription',\n                            data: JSON.stringify(data),\n                            txn_data: JSON.stringify(txn_data),\n                            _wpnonce: '6171179564',\n                        }).toString();\n\n                        try {\n                            const requestUrl = \"https:\/\/emendedhearts.com\/wp-admin\/admin-ajax.php\";\n                            const resp = await fetch( requestUrl, {\n                                method: \"post\",\n                                headers: {\n                                    'Content-Type': 'application\/x-www-form-urlencoded'\n                                },\n                                body: post_data\n                            });\n\n                            const response = await resp.json();\n\n                            \/\/console.log( 'Response from the server: ' + JSON.stringify( response ) );\n                            if ( response.success ) {\n\n                                \/\/Redirect to the Thank you page or Registration page URL if it is set.\n                                const return_url = response.redirect_url || '';\n                                if( return_url ){\n                                    \/\/redirect to the URL.\n                                    console.log('Redirecting to the Thank you page URL: ' + return_url);\n                                    window.location.href = return_url;\n                                    return;\n                                }\n\n                                \/\/No return URL is set. Just show a success message.\n                                \/\/Important Note: any alert message will block the normal PayPal popup window flow. So we want to show the message on the page instead of using alert.\n                                txn_success_msg = 'Transaction completed successfully!';\n                                const swpm_btn_wrapper_div = document.getElementById('swpm-button-wrapper-13463');\n                                if (swpm_btn_wrapper_div) {\n                                    \/\/ Remove any previous message if it exists\n                                    const old_msg_div = swpm_btn_wrapper_div.querySelector('.swpm-ppcp-txn-success-message');\n                                    if (old_msg_div) old_msg_div.remove();\n\n                                    \/\/ Create new message div\n                                    const new_msg_div = document.createElement('div');\n                                    new_msg_div.className = 'swpm-ppcp-txn-success-message';\n                                    new_msg_div.textContent = txn_success_msg;\n\n                                    \/\/Insert the message div before the button.\n                                    const firstChild = swpm_btn_wrapper_div.firstChild;\n                                    swpm_btn_wrapper_div.insertBefore(new_msg_div, firstChild);\n                                }\n\n                                \/\/ Trigger a event on subscription complete \n                                document.dispatchEvent(new Event('swpm_paypal_subscriptions_complete'));\n                        \n                            } else {\n                                \/\/Error response from the AJAX IPN hanler. Throw error.\n                                throw new Error(response.err_msg);\n                            }\n\n                            \/\/Return the button and the spinner back to their orignal display state.\n                            pp_button_container.style.display = 'block'; \/\/ Show the buttons\n                            pp_button_spinner_container.style.display = 'none'; \/\/ Hide the spinner\n\n                        } catch (error) {\n                            \/\/ Show the error message.\n                            alert(error.message);\n                            console.error( error.message );\n                        }\n                    });\n                },\n    \n                \/\/ handle unrecoverable errors\n                onError: function(err) {\n                    console.error('An error prevented the user from checking out with PayPal. ' + JSON.stringify(err));\n                    alert( 'Error occurred during PayPal checkout process.\\n\\n' + JSON.stringify(err) );\n                }\n            });\n    \n            paypalSubButtonsComponent\n                .render('#swpm_paypal_button_2')\n                .catch((err) => {\n                    console.error('PayPal Buttons failed to render');\n                });\n        });\n    <\/script>\n    <style>\n        @keyframes swpm-pp-button-spinner {\n            to {transform: rotate(360deg);}\n        }\n        .swpm-pp-button-spinner {\n            margin: 0 auto;\n            text-indent: -9999px;\n            vertical-align: middle;\n            box-sizing: border-box;\n            position: relative;\n            width: 60px;\n            height: 60px;\n            border-radius: 50%;\n            border: 5px solid #ccc;\n            border-top-color: #0070ba;\n            animation: swpm-pp-button-spinner .6s linear infinite;\n        }\n        .swpm-pp-button-spinner-container {\n            width: 100%;\n            text-align: center;\n            margin-top:10px;\n            display: none;\n        }\n    <\/style>\n    <div class=\"swpm-pp-button-spinner-container\">\n        <div class=\"swpm-pp-button-spinner\"><\/div>\n    <\/div>\n    <\/div><!-- end of .swpm-button-wrapper -->\n    <\/div><\/center><\/p>","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"_themeisle_gutenberg_block_has_review":false,"footnotes":""},"class_list":["post-7043","page","type-page","status-publish","hentry"],"ams_acf":[],"_links":{"self":[{"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/pages\/7043","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/comments?post=7043"}],"version-history":[{"count":26,"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/pages\/7043\/revisions"}],"predecessor-version":[{"id":14173,"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/pages\/7043\/revisions\/14173"}],"wp:attachment":[{"href":"https:\/\/emendedhearts.com\/hi\/wp-json\/wp\/v2\/media?parent=7043"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}