Plugin Directory

Changeset 899647


Ignore:
Timestamp:
04/21/2014 06:57:29 PM (12 years ago)
Author:
gesman
Message:

version update

Location:
bitcoin-payments-for-woocommerce/trunk
Files:
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • bitcoin-payments-for-woocommerce/trunk/bitcoinway-woocommerce.php

    r898261 r899647  
    66Plugin URI: http://www.bitcoinway.com/
    77Description: 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.02
     8Version: 3.03
    99Author: BitcoinWay
    1010Author URI: http://www.bitcoinway.com/
  • bitcoin-payments-for-woocommerce/trunk/bwwc-bitcoin-gateway.php

    r898261 r899647  
    149149
    150150            //----------------------------------
     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            //----------------------------------
    151180            // NOTE: currenly this check is not performed.
    152181                //          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  
    99if (!defined('BWWC_PLUGIN_NAME'))
    1010  {
    11   define('BWWC_VERSION',           '3.02');
     11  define('BWWC_VERSION',           '3.03');
    1212
    1313  //-----------------------------------------------
  • bitcoin-payments-for-woocommerce/trunk/bwwc-utils.php

    r898261 r899647  
    599599    $cache_hit     = false;
    600600    $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>";
    602603
    603604
     
    632633            $rates[] = BWWC__get_exchange_rate_from_bitpay ($currency_code, $rate_type, $bwwc_settings);           // Requested bestrate
    633634
    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;
    637644    }
    638645    else
     
    645652            $rates[] = BWWC__get_exchange_rate_from_bitpay ($currency_code, $rate_type, $bwwc_settings);           // Requested bestrate
    646653
    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;
    650663    }
    651664
    652665
    653666    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    }
    655682    else
    656683        return $exchange_rate;
    657684
    658685}
     686//===========================================================================
     687
     688//===========================================================================
     689function BWWC__function_not_exists ($fname) { return !function_exists($fname); }
    659690//===========================================================================
    660691
     
    678709    $result = @BWWC__file_get_contents ($source_url, false, $bwwc_settings['exchange_rate_api_timeout_secs']);
    679710
    680     $rate_obj = json_decode(trim($result), true);
     711    $rate_obj = @json_decode(trim($result), true);
    681712
    682713
     
    698729    $result = @BWWC__file_get_contents ($source_url, false, $bwwc_settings['exchange_rate_api_timeout_secs']);
    699730
    700     $rate_obj = json_decode(trim($result), true);
     731    $rate_obj = @json_decode(trim($result), true);
    701732
    702733
     
    713744    $result = @BWWC__file_get_contents ($source_url, false, $bwwc_settings['exchange_rate_api_timeout_secs']);
    714745
    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;
    716749
    717750    foreach ($rate_objs as $rate_obj)
  • bitcoin-payments-for-woocommerce/trunk/readme.txt

    r898261 r899647  
    1919= Benefits =
    2020
    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.
    2225* Electrum wallet payment option completely removes dependency on any third party service and middlemen.
    2326* Accept payment in bitcoins for physical and digital downloadable products.
     
    2528* Flexible exchange rate calculations fully managed via administrative settings.
    2629* Zero fees and no commissions for bitcoin payments processing from any third party.
    27 * Support 16 different currencies.
    28 * Set main currency of your store in any of 16 currencies or bitcoin.
     30* Support for many currencies.
     31* Set main currency of your store in any currency or bitcoin.
    2932* Automatic conversion to bitcoin via realtime exchange rate feed and calculations.
    3033* Ability to set exchange rate calculation multiplier to compensate for any possible losses due to bank conversions and funds transfer fees.
     
    3336== Installation ==
    3437
    35 1. Install "Bitcoin Payments for WooCommerce" wordpress plugin just like any other Wordpress plugin.
    36 2. Activate.
     381.  Install WooCommerce plugin and configure your store (if you haven't done so already - http://wordpress.org/plugins/woocommerce/).
     392.  Install "Bitcoin Payments for WooCommerce" wordpress plugin just like any other Wordpress plugin.
     403.  Activate.
     414.  Download and install on your computer Electrum wallet program from here: https://electrum.org/
     425.  Run and setup your wallet.
     436.  Click on "Console" tab and run this command (to extend the size of wallet's gap limit): wallet.storage.put('gap_limit',100)
     447.  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
     468.  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.
     499.  Press [Save changes]
     5010. If you do not see any errors - your store is ready for operation and to access payments in bitcoins!
    3751
    3852
     
    6377
    6478== 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.
    6583
    6684= 3.02 =
Note: See TracChangeset for help on using the changeset viewer.