Changeset 2977311
- Timestamp:
- 10/11/2023 06:03:24 AM (2 years ago)
- Location:
- blockonomics-bitcoin-payments/trunk
- Files:
-
- 3 edited
-
blockonomics-woocommerce.php (modified) (6 diffs)
-
php/Blockonomics.php (modified) (5 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
blockonomics-bitcoin-payments/trunk/blockonomics-woocommerce.php
r2971235 r2977311 4 4 * Plugin URI: https://github.com/blockonomics/woocommerce-plugin 5 5 * Description: Accept Bitcoin Payments on your WooCommerce-powered website with Blockonomics 6 * Version: 3.6. 56 * Version: 3.6.6 7 7 * Author: Blockonomics 8 8 * Author URI: https://www.blockonomics.co … … 68 68 add_action('wp_enqueue_scripts', 'bnomics_register_stylesheets'); 69 69 add_action('wp_enqueue_scripts', 'bnomics_register_scripts'); 70 add_filter( 'display_post_states', 'bnomics_add_display_post_states', 10, 2 );71 70 add_filter("wp_list_pages_excludes", "bnomics_exclude_pages"); 72 73 function bnomics_add_display_post_states( $post_states, $post ) {74 if ( wc_get_page_id( 'payment' ) === $post->ID ) {75 $post_states['wc_page_for_payment'] = __( 'Blockonomics Payment Page', 'woocommerce' );76 }77 78 return $post_states;79 }80 71 81 72 function bnomics_exclude_pages( $exclude ) { … … 85 76 86 77 function add_payment_page_shortcode() { 78 // This is to make sure we only run the shortcode when executed to render the page. 79 // Because the shortcode can be run multiple times by other plugin like All in One SEO. 80 // Where it tries to build SEO content from the shortcode and this could lead to checkout page not loading correctly. 81 $currentFilter = current_filter(); 82 if ($currentFilter != 'the_content') { 83 return; 84 } 85 87 86 $show_order = isset($_GET["show_order"]) ? sanitize_text_field(wp_unslash($_GET['show_order'])) : ""; 88 87 $crypto = isset($_GET["crypto"]) ? sanitize_key($_GET['crypto']) : ""; … … 575 574 576 575 global $blockonomics_db_version; 577 $blockonomics_db_version = '1. 3';576 $blockonomics_db_version = '1.4'; 578 577 579 578 function blockonomics_create_table() { … … 620 619 function blockonomics_create_payment_page() 621 620 { 621 global $wp_rewrite; 622 623 if ( null === $wp_rewrite ) { 624 $wp_rewrite = new \WP_Rewrite; 625 } 622 626 wc_create_page( 623 627 'payment', … … 650 654 blockonomics_create_table(); 651 655 } 652 if (version_compare($installed_ver, '1. 3', '<')){ // Plugin version should be 1.3656 if (version_compare($installed_ver, '1.4', '<')){ // Plugin version should be 1.4 653 657 include_once(WC()->plugin_path().'/includes/admin/wc-admin-functions.php'); 654 658 blockonomics_create_payment_page(); -
blockonomics-bitcoin-payments/trunk/php/Blockonomics.php
r2971235 r2977311 462 462 // Load the checkout template 463 463 ob_start(); // Start buffering 464 include plugin_dir_path(__FILE__)."../templates/" .$template;464 include_once plugin_dir_path(__FILE__)."../templates/" .$template; 465 465 return ob_get_clean(); // Return the buffered content 466 466 } … … 608 608 $context['crypto_rate_str'] = $this->get_crypto_rate_from_params($order['expected_fiat'], $order['expected_satoshi']); 609 609 //Using svg library qrcode.php to generate QR Code in NoJS mode 610 $context['qrcode_svg_element'] = $this->generate_qrcode_svg_element($context['payment_uri']); 610 if($this->is_nojs_active()){ 611 $context['qrcode_svg_element'] = $this->generate_qrcode_svg_element($context['payment_uri']); 612 } 611 613 612 614 $context['total'] = $order['expected_fiat']; … … 826 828 $this->add_note_on_underpayment($order, $wc_order); 827 829 $this->send_email_on_underpayment($order); 828 $wc_order->save;829 830 } 830 831 else { … … 879 880 880 881 $this->update_order($order); 882 883 $blockonomics_currencies = $this->getSupportedCurrencies(); 884 $selected_currency = $blockonomics_currencies[$order['crypto']]; 885 $wc_order->set_payment_method_title($selected_currency['name']); 886 $wc_order->save(); 881 887 } 882 888 … … 897 903 898 904 public function generate_qrcode_svg_element($data) { 899 include plugin_dir_path(__FILE__) . 'qrcode.php';905 include_once plugin_dir_path(__FILE__) . 'qrcode.php'; 900 906 $codeText = sanitize_text_field($data); 901 907 return QRcode::svg($codeText); -
blockonomics-bitcoin-payments/trunk/readme.txt
r2971235 r2977311 4 4 Requires at least: 3.0.1 5 5 Tested up to: 6.3.1 6 Stable tag: 3.6. 56 Stable tag: 3.6.6 7 7 License: MIT 8 8 License URI: http://opensource.org/licenses/MIT … … 84 84 == Changelog == 85 85 86 = 3.6.6 = 87 * Fix plugin conflict where shortcode executed multiple times 88 * Fix page creation sometimes failing on upgrade 89 86 90 = 3.6.5 = 87 91 * Using a new internally created page as the payment page
Note: See TracChangeset
for help on using the changeset viewer.