{"id":315,"date":"2023-12-17T00:08:05","date_gmt":"2023-12-17T08:08:05","guid":{"rendered":"https:\/\/purecotcharts.com\/?page_id=315"},"modified":"2024-01-03T08:06:07","modified_gmt":"2024-01-03T16:06:07","slug":"platinum-membership","status":"publish","type":"page","link":"https:\/\/purecotcharts.com\/index.php\/platinum-membership\/","title":{"rendered":"Platinum Membership"},"content":{"rendered":"\n<p class=\"has-black-color has-text-color has-link-color wp-elements-c38afec45a661199530e4902fc00ef49 wp-block-paragraph\">Get access to 47 Instruments and 7 Asset Classes in one go! This is our highest value option. You get access to Commitment of Traders positioning data for Commercial traders plotted against the Instrument (ticker) price. This data is normalized so it is time series comparable and the charts have an easy zoom feature for sub-period viewing. CoT Data is released every Friday by the CFTC so the reports are updated weekly.<\/p>\n\n\n\n<p class=\"has-black-color has-text-color has-link-color wp-elements-80c3bbe84b0335d5f6212458df69af01 wp-block-paragraph\">By filling in your payment details you will receive a registration link on your email ID which is good for one Platinum membership. You will have a 7 day free trial period and your card will only be charged after this period ends. Once registered you will have access to the Platinum level charts. <strong>As a measure of security, we need to register your email ID for chart access. After you register, expect a 24 hour wait period for this to occur before your free trial access period starts.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Platinum Membership $199\/Month<\/strong><\/p>\n\n\n<div class=\"swpm-payment-button\">    <div id=\"swpm-button-wrapper-51\" 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.24\">\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: 'blue',\n                    shape: 'rect',\n                    height: 35,\n                    label: 'checkout',\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 = '51';\n                    pp_sub_bn_data.on_page_button_id = 'swpm_paypal_button_0';\n                    pp_sub_bn_data.item_name = 'Platinum Membership Payment';\n                    let post_data = 'action=swpm_pp_create_subscription&data=' + JSON.stringify(pp_sub_bn_data) + '&_wpnonce=63b7233db7';\n                    try {\n                        \/\/ Using fetch for AJAX request. This is supported in all modern browsers.\n                        const response = await fetch(\"https:\/\/purecotcharts.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-51');\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 = '51';\n                        data.on_page_button_id = 'swpm_paypal_button_0';\n                        data.item_name = 'Platinum Membership Payment';\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: '63b7233db7',\n                        }).toString();\n\n                        try {\n                            const requestUrl = \"https:\/\/purecotcharts.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-51');\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>\n","protected":false},"excerpt":{"rendered":"<p>Get access to 47 Instruments and 7 Asset Classes in one go! This is our highest value option. You get access to Commitment of Traders positioning data for Commercial traders plotted against the Instrument (ticker) price. This data is normalized so it is time series comparable and the charts have an easy zoom feature for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"om_disable_all_campaigns":false,"_uag_custom_page_level_css":"","_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_swt_meta_header_display":false,"_swt_meta_footer_display":false,"_swt_meta_site_title_display":false,"_swt_meta_sticky_header":false,"_swt_meta_transparent_header":false,"footnotes":""},"class_list":["post-315","page","type-page","status-publish","hentry"],"aioseo_notices":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"purecotcharts.com","author_link":"https:\/\/purecotcharts.com\/index.php\/author\/purecotcharts-com\/"},"uagb_comment_info":0,"uagb_excerpt":"Get access to 47 Instruments and 7 Asset Classes in one go! This is our highest value option. You get access to Commitment of Traders positioning data for Commercial traders plotted against the Instrument (ticker) price. This data is normalized so it is time series comparable and the charts have an easy zoom feature for&hellip;","_links":{"self":[{"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/pages\/315","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/comments?post=315"}],"version-history":[{"count":5,"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/pages\/315\/revisions"}],"predecessor-version":[{"id":424,"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/pages\/315\/revisions\/424"}],"wp:attachment":[{"href":"https:\/\/purecotcharts.com\/index.php\/wp-json\/wp\/v2\/media?parent=315"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}