Plugin Directory

Changeset 686643


Ignore:
Timestamp:
03/24/2013 03:53:16 PM (13 years ago)
Author:
gesman
Message:

1.24 version update

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

Legend:

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

    r685646 r686643  
    1212Plugin URI: http://www.bitcoinway.com/
    1313Description: Bitcoin Payments for WooCommerce plugin allows you to accept payments in bitcoins for physical and digital products at your WooCommerce-powered online store.
    14 Version: 1.23
     14Version: 1.24
    1515Author: BitcoinWay
    1616Author URI: http://www.bitcoinway.com/
  • bitcoin-payments-for-woocommerce/trunk/bwwc-bitcoin-gateway.php

    r685646 r686643  
    7777
    7878            // Hook IPN callback logic
    79             add_action('init', array(&$this, 'BWWC__maybe_bitcoin_ipn_callback'));
     79            if (version_compare (WOOCOMMERCE_VERSION, '2.0', '<'))
     80                add_action('init', array(&$this, 'BWWC__maybe_bitcoin_ipn_callback'));
     81            else
     82                add_action('woocommerce_api_' . strtolower(get_class($this)), array($this,'BWWC__maybe_bitcoin_ipn_callback'));
    8083
    8184            // Validate currently set currency for the store. Must be among supported ones.
     
    263266
    264267            $bitcoin_addr_merchant = $this->bitcoin_addr_merchant;
    265             $callback_url = trailingslashit (home_url()) . "?bitcoinway=1&src=bcinfo&order_id={$order_id}"; // http://www.example.com/?bitcoinway=1&order_id=74&src=bcinfo
    266             BWWC__log_event (__FILE__, __LINE__, "Calling BWWC__generate_temporary_bitcoin_address(). Payments to be forwarded to: '{$bitcoin_addr_merchant}' with callback URL: '{$callback_url}' ...");
     268            $callback_url = trailingslashit (home_url()) . "?wc-api=BWWC_Bitcoin&bitcoinway=1&src=bcinfo&order_id={$order_id}"; // http://www.example.com/?bitcoinway=1&order_id=74&src=bcinfo
     269        BWWC__log_event (__FILE__, __LINE__, "Calling BWWC__generate_temporary_bitcoin_address(). Payments to be forwarded to: '{$bitcoin_addr_merchant}' with callback URL: '{$callback_url}' ...");
    267270
    268271            // This function generates temporary bitcoin address and schedules IPN callback at the same
     
    277280                exit ('<h2 style="color:red;">' . $msg . '</h2>');
    278281            }
    279             BWWC__log_event (__FILE__, __LINE__, "     Generated unique bitcoin address: '{$bitcoins_address}' for order_id " . $order_id);
    280 
    281             update_post_meta (
    282                 $order_id,          // post id ($order_id)
    283                 'order_total_in_btc',   // meta key
    284                 $order_total_in_btc     // meta value. If array - will be auto-serialized
    285                 );
    286             update_post_meta (
    287                 $order_id,          // post id ($order_id)
    288                 'bitcoins_address', // meta key
    289                 $bitcoins_address   // meta value. If array - will be auto-serialized
    290                 );
    291             update_post_meta (
    292                 $order_id,          // post id ($order_id)
    293                 'bitcoins_paid_total',  // meta key
    294                 "0"     // meta value. If array - will be auto-serialized
    295                 );
    296             update_post_meta (
    297                 $order_id,              // post id ($order_id)
    298                 '_incoming_payments',   // meta key. Starts with '_' - hidden from UI.
    299                 array()                 // array (array('datetime'=>'', 'from_addr'=>'', 'amount'=>''),)
    300                 );
    301             update_post_meta (
    302                 $order_id,              // post id ($order_id)
    303                 '_payment_completed',   // meta key. Starts with '_' - hidden from UI.
    304                 0                   // array (array('datetime'=>'', 'from_addr'=>'', 'amount'=>''),)
    305                 );
     282       
     283        BWWC__log_event (__FILE__, __LINE__, "     Generated unique bitcoin address: '{$bitcoins_address}' for order_id " . $order_id);
     284
     285        update_post_meta (
     286            $order_id,          // post id ($order_id)
     287            'order_total_in_btc',   // meta key
     288            $order_total_in_btc     // meta value. If array - will be auto-serialized
     289            );
     290        update_post_meta (
     291            $order_id,          // post id ($order_id)
     292            'bitcoins_address', // meta key
     293            $bitcoins_address   // meta value. If array - will be auto-serialized
     294            );
     295        update_post_meta (
     296            $order_id,          // post id ($order_id)
     297            'bitcoins_paid_total',  // meta key
     298            "0"     // meta value. If array - will be auto-serialized
     299            );
     300        update_post_meta (
     301            $order_id,              // post id ($order_id)
     302            '_incoming_payments',   // meta key. Starts with '_' - hidden from UI.
     303            array()                 // array (array('datetime'=>'', 'from_addr'=>'', 'amount'=>''),)
     304            );
     305        update_post_meta (
     306            $order_id,              // post id ($order_id)
     307            '_payment_completed',   // meta key. Starts with '_' - hidden from UI.
     308            0                   // array (array('datetime'=>'', 'from_addr'=>'', 'amount'=>''),)
     309            );
    306310            //-----------------------------------
    307311
     
    422426            if (isset($_REQUEST['bitcoinway']) && $_REQUEST['bitcoinway'] == '1')
    423427            {
    424                 BWWC__log_event (__FILE__, __LINE__, "BWWC__maybe_bitcoin_ipn_callback () called and 'bitcoinway=1' detected. REQUEST  =  " . serialize(@$_REQUEST));
     428            BWWC__log_event (__FILE__, __LINE__, "BWWC__maybe_bitcoin_ipn_callback () called and 'bitcoinway=1' detected. REQUEST  =  " . serialize(@$_REQUEST));
    425429
    426430                if (@$_GET['src'] != 'bcinfo')
     
    441445                if ($must_be_prefix != $originated_prefix)
    442446                {
    443                     BWWC__log_event (__FILE__, __LINE__, "Warning: wrong originating IP address: " . $_SERVER['REMOTE_ADDR'] . ". Expected prefix: " . $originated_prefix . ". Fraud? IPN request ignored...");
    444                     exit ('Bad IP');
     447                    BWWC__log_event (__FILE__, __LINE__, "Warning: wrong originating IP address: " . $_SERVER['REMOTE_ADDR'] . ". Expected prefix: " . $must_be_prefix . ". Fraud? IPN request ignored...");
     448                   
     449                    //////!!!
     450                    BWWC__log_event (__FILE__, __LINE__, "Temporary proceeding with processing.");
     451                    /// More security validation will be added soon
     452                    //////!!!
     453                    ///!!!exit ('Bad IP');
    445454                }
    446455
  • bitcoin-payments-for-woocommerce/trunk/bwwc-include-all.php

    r685646 r686643  
    77//---------------------------------------------------------------------------
    88// Global definitions
    9 define('BWWC_VERSION',           '1.23');
     9define('BWWC_VERSION',           '1.24');
    1010
    1111//-----------------------------------------------
  • bitcoin-payments-for-woocommerce/trunk/bwwc-utils.php

    r678268 r686643  
    6161
    6262
    63    $result = @BWWC__file_get_contents ("https://blockchain.info/api/receive?method=create&address={$forwarding_bitcoin_address}&anonymous=false&callback={$callback_url}", true);
     63   $blockchain_api_call = "https://blockchain.info/api/receive?method=create&address={$forwarding_bitcoin_address}&anonymous=false&callback={$callback_url}";
     64   BWWC__log_event (__FILE__, __LINE__, "Calling blockchain.info API: " . $blockchain_api_call);
     65   $result = @BWWC__file_get_contents ($blockchain_api_call, true);
    6466   if ($result)
    6567   {
  • bitcoin-payments-for-woocommerce/trunk/readme.txt

    r685646 r686643  
    4747== Changelog ==
    4848
     49= 1.24 =
     50* Fixed IPN callback notification invocation specific to WC 2.x
     51
    4952= 1.23 =
    5053* Fixed incoming IP check logic for IPN (payment notification) requests.
Note: See TracChangeset for help on using the changeset viewer.