Skip to content

Commit

Permalink
v1.2.3
Browse files Browse the repository at this point in the history
- Minor bugfixes
  • Loading branch information
arianoangelo committed Oct 9, 2024
1 parent b1613d1 commit 618016f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion BlockBee.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
20 changes: 10 additions & 10 deletions controllers/BlockBee.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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']);
Expand Down Expand Up @@ -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');

Expand Down Expand Up @@ -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']
];
Expand Down Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion define.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

define('BLOCKBEE_PLUGIN_VERSION', '1.2.2');
define('BLOCKBEE_PLUGIN_VERSION', '1.2.3');
define('BLOCKBEE_PLUGIN_PATH', plugin_dir_path(__FILE__));
define('BLOCKBEE_PLUGIN_URL', plugin_dir_url(__FILE__));
5 changes: 4 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: blockbee
Tags: crypto payments, payment gateway, cryptocurrencies, payments,
Requires at least: 5.8
Tested up to: 6.6.2
Stable tag: 1.2.2
Stable tag: 1.2.3
Requires PHP: 7.2
WC requires at least: 5.8
WC tested up to: 9.3.3
Expand Down Expand Up @@ -263,4 +263,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 ==

0 comments on commit 618016f

Please sign in to comment.