From 618016f3635fd4578f75ec59cfcba14a5257151d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ariano=20Fonseca=20=C3=82ngelo?= Date: Wed, 9 Oct 2024 11:10:46 +0200 Subject: [PATCH] v1.2.3 - Minor bugfixes --- BlockBee.php | 2 +- README.md | 3 +++ controllers/BlockBee.php | 20 ++++++++++---------- define.php | 2 +- readme.txt | 5 ++++- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/BlockBee.php b/BlockBee.php index 1dc7483..f973c27 100644 --- a/BlockBee.php +++ b/BlockBee.php @@ -3,7 +3,7 @@ Plugin Name: BlockBee Cryptocurrency Payment Gateway Plugin URI: https://blockbee.io/resources/woocommerce/ Description: Accept cryptocurrency payments on your WooCommerce website -Version: 1.2.2 +Version: 1.2.3 Requires at least: 5.8 Tested up to: 6.6.2 WC requires at least: 5.8 diff --git a/README.md b/README.md index 0fdba89..6c89565 100644 --- a/README.md +++ b/README.md @@ -251,4 +251,7 @@ The easiest and fastest way is via our live chat on our [website](https://blockb #### 1.2.2 * Minor fixes +#### 1.2.3 +* Minor fixes + ### Upgrade Notice diff --git a/controllers/BlockBee.php b/controllers/BlockBee.php index b496fe4..9b2ddef 100644 --- a/controllers/BlockBee.php +++ b/controllers/BlockBee.php @@ -545,7 +545,7 @@ function process_payment($order_id) $load_coins = $this->load_coins(); $info = BlockBee\Helper::get_info($selected); - $min_tx = BlockBee\Helper::sig_fig($info->minimum_transaction_coin, 6); + $min_tx = BlockBee\Helper::sig_fig($info->minimum_transaction_coin, 8); $crypto_total = BlockBee\Helper::get_conversion($currency, $selected, $total, $this->disable_conversion); @@ -573,7 +573,7 @@ function process_payment($order_id) $order->add_meta_data('blockbee_php_version', PHP_VERSION); $order->add_meta_data('blockbee_nonce', $nonce); $order->add_meta_data('blockbee_address', $addr_in); - $order->add_meta_data('blockbee_total', BlockBee\Helper::sig_fig($crypto_total, 6)); + $order->add_meta_data('blockbee_total', BlockBee\Helper::sig_fig($crypto_total, 8)); $order->add_meta_data('blockbee_total_fiat', $total); $order->add_meta_data('blockbee_currency', $selected); $order->add_meta_data('blockbee_qr_code_value', $qr_code_data_value['qr_code']); @@ -800,7 +800,7 @@ function process_callback_data($data, $order, $validation = false) $saved_coin = $order->get_meta('blockbee_currency'); - $paid = (float)$data['value_coin']; + $paid = $data['value_coin']; $min_tx = (float)$order->get_meta('blockbee_min'); @@ -831,7 +831,7 @@ function process_callback_data($data, $order, $validation = false) $history[$data['uuid']] = [ 'timestamp' => time(), - 'value_paid' => BlockBee\Helper::sig_fig($paid, 6), + 'value_paid' => BlockBee\Helper::sig_fig($paid, 8), 'value_paid_fiat' => $conversion[strtoupper($order->get_currency())], 'pending' => $data['pending'] ]; @@ -1311,14 +1311,14 @@ function calc_order($history, $total, $total_fiat) if (!empty($history)) { foreach ($history as $uuid => $item) { if ((int)$item['pending'] === 0) { - $remaining = bcsub(BlockBee\Helper::sig_fig($remaining, 6), $item['value_paid'], 8); + $remaining = bcsub(BlockBee\Helper::sig_fig($remaining, 8), $item['value_paid'], 8); } - $remaining_pending = bcsub(BlockBee\Helper::sig_fig($remaining_pending, 6), $item['value_paid'], 8); - $remaining_fiat = bcsub(BlockBee\Helper::sig_fig($remaining_fiat, 6), $item['value_paid_fiat'], 8); + $remaining_pending = bcsub(BlockBee\Helper::sig_fig($remaining_pending, 8), $item['value_paid'], 8); + $remaining_fiat = bcsub(BlockBee\Helper::sig_fig($remaining_fiat, 8), $item['value_paid_fiat'], 8); - $already_paid = bcadd(BlockBee\Helper::sig_fig($already_paid, 6), $item['value_paid'], 8); - $already_paid_fiat = bcadd(BlockBee\Helper::sig_fig($already_paid_fiat, 6), $item['value_paid_fiat'], 8); + $already_paid = bcadd(BlockBee\Helper::sig_fig($already_paid, 8), $item['value_paid'], 8); + $already_paid_fiat = bcadd(BlockBee\Helper::sig_fig($already_paid_fiat, 8), $item['value_paid_fiat'], 8); } } @@ -1580,7 +1580,7 @@ function refresh_value($order) $blockbee_coin = $order->get_meta('blockbee_currency'); $crypto_conversion = (float)BlockBee\Helper::get_conversion($woocommerce_currency, $blockbee_coin, $order_total, $this->disable_conversion); - $crypto_total = BlockBee\Helper::sig_fig($crypto_conversion, 6); + $crypto_total = BlockBee\Helper::sig_fig($crypto_conversion, 8); $order->update_meta_data('blockbee_total', $crypto_total); $calc_cron = $this->calc_order($history, $crypto_total, $order_total); diff --git a/define.php b/define.php index 2969fb6..623ae02 100644 --- a/define.php +++ b/define.php @@ -1,5 +1,5 @@