Changeset 1347999
- Timestamp:
- 02/11/2016 05:11:17 AM (10 years ago)
- Location:
- satoshipay/trunk
- Files:
-
- 3 edited
-
assets/js/script_admin.js (modified) (4 diffs)
-
readme.txt (modified) (4 diffs)
-
satoshipay.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
satoshipay/trunk/assets/js/script_admin.js
r1338096 r1347999 2 2 var oldSecretPattern = new RegExp(/^[0-9a-f]{40}$/); 3 3 var keyPattern = new RegExp(/^[0-9A-Za-z]{17}$/); 4 var SATOSHIPAY_LAST_API_KEY; 5 var SATOSHIPAY_LAST_API_SECRET; 6 var SATOSHIPAY_REMOTE_CHECK_DONE = false; 7 var SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL = false; 8 9 SATOSHIPAY_LOG = false; 4 10 5 11 var wrapError = function (errorText) { … … 16 22 var providerApiUrl = 'https://provider-api.satoshipay.io/v1'; 17 23 24 25 var log = function (string) { 26 if (SATOSHIPAY_LOG) { 27 console.log(string); 28 } 29 }; 30 18 31 var activateButtons = function () { 19 jQuery('#satoshipay-error-dismiss').on('click', function () {32 jQuery('#satoshipay-error-dismiss').on('click', function () { 20 33 removeErrors(); 21 34 }); … … 77 90 }); 78 91 }; 92 93 var remoteCheckSuccessful = function (apiKey, apiSecret) { 94 if (SATOSHIPAY_REMOTE_CHECK_DONE) { 95 if (apiKey === SATOSHIPAY_LAST_API_KEY && apiSecret === SATOSHIPAY_LAST_API_SECRET) { 96 return SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL; 97 } 98 } 99 return false; 100 }; 101 102 79 103 var removeErrors = function () { 80 104 jQuery('.satoshipay-error').html(''); … … 86 110 jQuery('.wrap').find('h2').first().after('<div class="satoshipay-error"></div>'); 87 111 88 var remoteCheckDone = false; 89 var remoteCheckSuccessful = false; 112 var apiSecret = jQuery('#satoshipay_api_auth_secret').val(); 113 var apiKey = jQuery('#satoshipay_api_auth_key').val(); 114 90 115 jQuery('form').submit(function (event) { 91 if (remoteCheckDone) { 92 remoteCheckDone = false; 93 return remoteCheckSuccessful; 116 if (remoteCheckSuccessful(apiKey, apiSecret)) { 117 log('Remote check done, returning result'); 118 return; 119 } 120 event.preventDefault(); 121 if (SATOSHIPAY_REMOTE_CHECK_DONE) { 122 SATOSHIPAY_REMOTE_CHECK_DONE = false; 94 123 } 95 124 removeErrors(); 96 125 if (localApiKeyCheck() && localApiSecretCheck()) { 97 126 remoteCredCheck(function (err, result) { 127 SATOSHIPAY_LAST_API_KEY = apiKey; 128 SATOSHIPAY_LAST_API_SECRET = apiSecret; 129 SATOSHIPAY_REMOTE_CHECK_DONE = true; 98 130 if (!err) { 99 remoteCheckSuccessful = true; 131 SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL = true; 132 jQuery('form').submit(); 133 } else { 134 SATOSHIPAY_REMOTE_CHECK_SUCCESSFUL = false; 100 135 } 101 remoteCheckDone = true;102 jQuery('form').submit();103 136 }); 137 log('Local checks passed, delaying submit and waiting for remote check to be completed.'); 104 138 return false; 105 139 } -
satoshipay/trunk/readme.txt
r1338142 r1347999 4 4 Tags: micropayments, bitcoin, paywall, paid content, payment, satoshipay, nanopayments, widget, adblocking 5 5 Requires at least: 4.0 6 Tested up to: 4.4. 17 Stable tag: 0.6 6 Tested up to: 4.4.2 7 Stable tag: 0.6.1 8 8 License: GPL2 9 9 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 29 29 = How do I show a free teaser of my paid content? = 30 30 31 Use an excerpt. When editing a post you can enter your teaser in the Excerpt box underneath the post edit box. The excerpt text will always be shown for free when viewing the post. If you don't see the Excerpt box when editing, activate Screen Options > Boxes > Excerpt. 31 Use an excerpt. When editing a post you can enter your teaser in the Excerpt box underneath the post edit box. The excerpt text will always be shown for free when viewing the post. 32 If you don't see the Excerpt box when editing, activate Screen Options > Boxes > Excerpt. 33 34 = Will SatoshiPay work well with my other plugins? = 35 36 Yes. We ensured that our plugin is compatible with the most popular WordPress plugins. However, there are a few known issues: 37 38 ** [Duplicate Post plugin](https://wordpress.org/plugins/duplicate-post/) ** 39 40 Issue: The duplicate of a post with "Paid content" enabled will not show up when displayed on the same page with the original. 41 42 Solution: Unfortunately there is currently no work-around for this. 43 44 ** [W3 Total Cache plugin](https://wordpress.org/plugins/w3-total-cache/) ** 45 46 Issue: SatoshiPay's ad blocker detection feature will not work. 47 48 Solution: Disable Page Cache (W3 Total Cache settings > General Settings > Disable Page cache). You can enable all other caching features. 32 49 33 50 = Where can I find more documentation on SatoshiPay? = … … 45 62 46 63 == Changelog == 64 65 = 0.6.1 = 66 67 * Added known issues to FAQ. 68 * Fixed compatibility issue with Jetpack plugin. 47 69 48 70 = 0.6 = … … 63 85 * Added plugin directory icon and banner. 64 86 65 = 0.5 .0=87 = 0.5 = 66 88 67 89 * Initial release. -
satoshipay/trunk/satoshipay.php
r1338096 r1347999 12 12 * Plugin URI: https://wordpress.org/plugins/satoshipay/ 13 13 * Description: Integrates SatoshiPay into WordPress. Quick start: 1) Select SatoshiPay from the left-hand admin menu, 2) add SatoshiPay API credentials, 3) edit a post, 4) activate "Paid Content" in SatoshiPay meta box, 5) set a price, 6) publish and view post. The SatoshiPay widget will appear and allow you to pay for the post. 14 * Version: 0.6 14 * Version: 0.6.1 15 15 * Author: SatoshiPay 16 16 * Author URI: https://satoshipay.io … … 30 30 // Plugin version, used in user-agent string for API calls; keep in sync with 31 31 // version in plugin description above! 32 define('SATOSHIPAY_VERSION', '0.6 ');32 define('SATOSHIPAY_VERSION', '0.6.1'); 33 33 34 34 // Load configuration, silently ignore missing config.php
Note: See TracChangeset
for help on using the changeset viewer.