Changeset 686643
- Timestamp:
- 03/24/2013 03:53:16 PM (13 years ago)
- Location:
- bitcoin-payments-for-woocommerce/trunk
- Files:
-
- 5 edited
-
bitcoinway-woocommerce.php (modified) (1 diff)
-
bwwc-bitcoin-gateway.php (modified) (5 diffs)
-
bwwc-include-all.php (modified) (1 diff)
-
bwwc-utils.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
bitcoin-payments-for-woocommerce/trunk/bitcoinway-woocommerce.php
r685646 r686643 12 12 Plugin URI: http://www.bitcoinway.com/ 13 13 Description: 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.2 314 Version: 1.24 15 15 Author: BitcoinWay 16 16 Author URI: http://www.bitcoinway.com/ -
bitcoin-payments-for-woocommerce/trunk/bwwc-bitcoin-gateway.php
r685646 r686643 77 77 78 78 // 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')); 80 83 81 84 // Validate currently set currency for the store. Must be among supported ones. … … 263 266 264 267 $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=bcinfo266 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}' ..."); 267 270 268 271 // This function generates temporary bitcoin address and schedules IPN callback at the same … … 277 280 exit ('<h2 style="color:red;">' . $msg . '</h2>'); 278 281 } 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 ); 306 310 //----------------------------------- 307 311 … … 422 426 if (isset($_REQUEST['bitcoinway']) && $_REQUEST['bitcoinway'] == '1') 423 427 { 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)); 425 429 426 430 if (@$_GET['src'] != 'bcinfo') … … 441 445 if ($must_be_prefix != $originated_prefix) 442 446 { 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'); 445 454 } 446 455 -
bitcoin-payments-for-woocommerce/trunk/bwwc-include-all.php
r685646 r686643 7 7 //--------------------------------------------------------------------------- 8 8 // Global definitions 9 define('BWWC_VERSION', '1.2 3');9 define('BWWC_VERSION', '1.24'); 10 10 11 11 //----------------------------------------------- -
bitcoin-payments-for-woocommerce/trunk/bwwc-utils.php
r678268 r686643 61 61 62 62 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); 64 66 if ($result) 65 67 { -
bitcoin-payments-for-woocommerce/trunk/readme.txt
r685646 r686643 47 47 == Changelog == 48 48 49 = 1.24 = 50 * Fixed IPN callback notification invocation specific to WC 2.x 51 49 52 = 1.23 = 50 53 * Fixed incoming IP check logic for IPN (payment notification) requests.
Note: See TracChangeset
for help on using the changeset viewer.