Changeset 899647
- Timestamp:
- 04/21/2014 06:57:29 PM (12 years ago)
- Location:
- bitcoin-payments-for-woocommerce/trunk
- Files:
-
- 3 deleted
- 5 edited
-
bitcoinway-woocommerce.php (modified) (1 diff)
-
bwwc-bitcoin-gateway.php (modified) (1 diff)
-
bwwc-include-all.php (modified) (1 diff)
-
bwwc-utils.php (modified) (6 diffs)
-
readme.txt (modified) (4 diffs)
-
screenshot-1.png (deleted)
-
screenshot-2.png (deleted)
-
screenshot-3.png (deleted)
Legend:
- Unmodified
- Added
- Removed
-
bitcoin-payments-for-woocommerce/trunk/bitcoinway-woocommerce.php
r898261 r899647 6 6 Plugin URI: http://www.bitcoinway.com/ 7 7 Description: Bitcoin Payments for WooCommerce plugin allows you to accept payments in bitcoins for physical and digital products at your WooCommerce-powered online store. 8 Version: 3.0 28 Version: 3.03 9 9 Author: BitcoinWay 10 10 Author URI: http://www.bitcoinway.com/ -
bitcoin-payments-for-woocommerce/trunk/bwwc-bitcoin-gateway.php
r898261 r899647 149 149 150 150 //---------------------------------- 151 // Validate connection to exchange rate services 152 153 $store_currency_code = get_woocommerce_currency(); 154 if ($store_currency_code != 'BTC') 155 { 156 $currency_rate = BWWC__get_exchange_rate_per_bitcoin ($store_currency_code, 'getfirst', 'bestrate', false); 157 if (!$currency_rate) 158 { 159 $valid = false; 160 161 // Assemble error message. 162 $error_msg = "ERROR: Cannot determine exchange rates! {{{ERROR_MESSAGE}}} Make sure your PHP settings are configured properly and your server can (is allowed to) connect to external WEB services via PHP."; 163 $extra_error_message = ""; 164 $fns = array ('file_get_contents', 'curl_init', 'curl_setopt', 'curl_setopt_array', 'curl_exec'); 165 $fns = array_filter ($fns, 'BWWC__function_not_exists'); 166 $extra_error_message = ""; 167 if (count($fns)) 168 $extra_error_message = "The following PHP functions are disabled on your server: " . implode (", ", $fns) . "."; 169 170 $reason_message = str_replace('{{{ERROR_MESSAGE}}}', $extra_error_message, $error_msg); 171 172 if ($ret_reason_message !== NULL) 173 $ret_reason_message = $reason_message; 174 return false; 175 } 176 } 177 //---------------------------------- 178 179 //---------------------------------- 151 180 // NOTE: currenly this check is not performed. 152 181 // Do not limit support with present list of currencies. This was originally created because exchange rate APIs did not support many, but today -
bitcoin-payments-for-woocommerce/trunk/bwwc-include-all.php
r898261 r899647 9 9 if (!defined('BWWC_PLUGIN_NAME')) 10 10 { 11 define('BWWC_VERSION', '3.0 2');11 define('BWWC_VERSION', '3.03'); 12 12 13 13 //----------------------------------------------- -
bitcoin-payments-for-woocommerce/trunk/bwwc-utils.php
r898261 r899647 599 599 $cache_hit = false; 600 600 $requested_cache_method_type = $rate_retrieval_method . '|' . $rate_type; 601 $ticker_string = "<span style='color:darkgreen;'>Current Rates for 1 Bitcoin (according to settings) (in {$currency_code})={{{EXCHANGE_RATE}}}</span>"; 601 $ticker_string = "<span style='color:darkgreen;'>Current Rates for 1 Bitcoin (in {$currency_code})={{{EXCHANGE_RATE}}}</span>"; 602 $ticker_string_error = "<span style='color:red;background-color:#FFA'>WARNING: Cannot determine exchange rates! {{{ERROR_MESSAGE}}} Make sure your PHP settings are configured properly and your server can (is allowed to) connect to external WEB services via PHP.</span>"; 602 603 603 604 … … 632 633 $rates[] = BWWC__get_exchange_rate_from_bitpay ($currency_code, $rate_type, $bwwc_settings); // Requested bestrate 633 634 634 $exchange_rate = min(array_filter ($rates)); 635 // Save new currency exchange rate info in cache 636 BWWC__update_exchange_rate_cache ($currency_code, $requested_cache_method_type, $exchange_rate); 635 $rates = array_filter ($rates); 636 if (count($rates) && $rates[0]) 637 { 638 $exchange_rate = min($rates); 639 // Save new currency exchange rate info in cache 640 BWWC__update_exchange_rate_cache ($currency_code, $requested_cache_method_type, $exchange_rate); 641 } 642 else 643 $exchange_rate = false; 637 644 } 638 645 else … … 645 652 $rates[] = BWWC__get_exchange_rate_from_bitpay ($currency_code, $rate_type, $bwwc_settings); // Requested bestrate 646 653 647 $exchange_rate = min(array_filter ($rates)); 648 if ($exchange_rate) // If array contained only meaningless data (all 'false's) 649 BWWC__update_exchange_rate_cache ($currency_code, $requested_cache_method_type, $exchange_rate); 654 $rates = array_filter ($rates); 655 if (count($rates) && $rates[0]) 656 { 657 $exchange_rate = min($rates); 658 // Save new currency exchange rate info in cache 659 BWWC__update_exchange_rate_cache ($currency_code, $requested_cache_method_type, $exchange_rate); 660 } 661 else 662 $exchange_rate = false; 650 663 } 651 664 652 665 653 666 if ($get_ticker_string) 654 return str_replace('{{{EXCHANGE_RATE}}}', $exchange_rate, $ticker_string); 667 { 668 if ($exchange_rate) 669 return str_replace('{{{EXCHANGE_RATE}}}', $exchange_rate, $ticker_string); 670 else 671 { 672 $extra_error_message = ""; 673 $fns = array ('file_get_contents', 'curl_init', 'curl_setopt', 'curl_setopt_array', 'curl_exec'); 674 $fns = array_filter ($fns, 'BWWC__function_not_exists'); 675 676 if (count($fns)) 677 $extra_error_message = "The following PHP functions are disabled on your server: " . implode (", ", $fns) . "."; 678 679 return str_replace('{{{ERROR_MESSAGE}}}', $extra_error_message, $ticker_string_error); 680 } 681 } 655 682 else 656 683 return $exchange_rate; 657 684 658 685 } 686 //=========================================================================== 687 688 //=========================================================================== 689 function BWWC__function_not_exists ($fname) { return !function_exists($fname); } 659 690 //=========================================================================== 660 691 … … 678 709 $result = @BWWC__file_get_contents ($source_url, false, $bwwc_settings['exchange_rate_api_timeout_secs']); 679 710 680 $rate_obj = json_decode(trim($result), true);711 $rate_obj = @json_decode(trim($result), true); 681 712 682 713 … … 698 729 $result = @BWWC__file_get_contents ($source_url, false, $bwwc_settings['exchange_rate_api_timeout_secs']); 699 730 700 $rate_obj = json_decode(trim($result), true);731 $rate_obj = @json_decode(trim($result), true); 701 732 702 733 … … 713 744 $result = @BWWC__file_get_contents ($source_url, false, $bwwc_settings['exchange_rate_api_timeout_secs']); 714 745 715 $rate_objs = json_decode(trim($result), true); 746 $rate_objs = @json_decode(trim($result), true); 747 if (!is_array($rate_objs)) 748 return false; 716 749 717 750 foreach ($rate_objs as $rate_obj) -
bitcoin-payments-for-woocommerce/trunk/readme.txt
r898261 r899647 19 19 = Benefits = 20 20 21 * Accept payment directly into your personal Electrum wallet. 21 * Fully automatic operation 22 * 100% hack secure - by design it is impossible for hacker to steal your bitcoins even if your whole server and database will be hacked. 23 * 100% safe against losses - no private keys are required or kept anywhere at your online store server. 24 * Accept payments in bitcoins directly into your personal Electrum wallet. 22 25 * Electrum wallet payment option completely removes dependency on any third party service and middlemen. 23 26 * Accept payment in bitcoins for physical and digital downloadable products. … … 25 28 * Flexible exchange rate calculations fully managed via administrative settings. 26 29 * Zero fees and no commissions for bitcoin payments processing from any third party. 27 * Support 16 differentcurrencies.28 * Set main currency of your store in any of 16 currenciesor bitcoin.30 * Support for many currencies. 31 * Set main currency of your store in any currency or bitcoin. 29 32 * Automatic conversion to bitcoin via realtime exchange rate feed and calculations. 30 33 * Ability to set exchange rate calculation multiplier to compensate for any possible losses due to bank conversions and funds transfer fees. … … 33 36 == Installation == 34 37 35 1. Install "Bitcoin Payments for WooCommerce" wordpress plugin just like any other Wordpress plugin. 36 2. Activate. 38 1. Install WooCommerce plugin and configure your store (if you haven't done so already - http://wordpress.org/plugins/woocommerce/). 39 2. Install "Bitcoin Payments for WooCommerce" wordpress plugin just like any other Wordpress plugin. 40 3. Activate. 41 4. Download and install on your computer Electrum wallet program from here: https://electrum.org/ 42 5. Run and setup your wallet. 43 6. Click on "Console" tab and run this command (to extend the size of wallet's gap limit): wallet.storage.put('gap_limit',100) 44 7. Grab your wallet's Master Public Key by navigating to: 45 Wallet -> Master Public Key, or (for older versions of Electrum): Preferences -> Import/Export -> Master Public Key -> Show 46 8. Within your site's Wordpress admin, navigate to: 47 WooCommerce -> Settings -> Checkout -> Bitcoin 48 and paste the value of Master Public Key into "Electrum wallet's Master Public Key" field. 49 9. Press [Save changes] 50 10. If you do not see any errors - your store is ready for operation and to access payments in bitcoins! 37 51 38 52 … … 63 77 64 78 == Changelog == 79 80 = 3.03 = 81 * Added validation of connection to BTC exchange rate services in setup screen to prevent running store with disabled internet connections or essential PHP functions disabled. 82 * Installation instructions updated within this file. 65 83 66 84 = 3.02 =
Note: See TracChangeset
for help on using the changeset viewer.