@@ -567,7 +567,7 @@ function process_payment($order_id)
567567 $currency = get_woocommerce_currency();
568568
569569 $info = CryptAPI\Helper::get_info($selected);
570- $min_tx = CryptAPI\Helper::sig_fig($info->minimum_transaction_coin, 6 );
570+ $min_tx = CryptAPI\Helper::sig_fig($info->minimum_transaction_coin, 8 );
571571
572572 $crypto_total = CryptAPI\Helper::get_conversion($currency, $selected, $total, $this->disable_conversion);
573573
@@ -594,7 +594,7 @@ function process_payment($order_id)
594594 $order->add_meta_data('cryptapi_php_version', PHP_VERSION);
595595 $order->add_meta_data('cryptapi_nonce', $nonce);
596596 $order->add_meta_data('cryptapi_address', $addr_in);
597- $order->add_meta_data('cryptapi_total', CryptAPI\Helper::sig_fig($crypto_total, 6 ));
597+ $order->add_meta_data('cryptapi_total', CryptAPI\Helper::sig_fig($crypto_total, 8 ));
598598 $order->add_meta_data('cryptapi_total_fiat', $total);
599599 $order->add_meta_data('cryptapi_currency', $selected);
600600 $order->add_meta_data('cryptapi_qr_code_value', $qr_code_data_value['qr_code']);
@@ -757,7 +757,7 @@ function process_callback_data($data, $order, $validation = false)
757757
758758 $saved_coin = $order->get_meta('cryptapi_currency');
759759
760- $paid = (float) $data['value_coin'];
760+ $paid = $data['value_coin'];
761761
762762 $min_tx = (float)$order->get_meta('cryptapi_min');
763763
@@ -786,7 +786,7 @@ function process_callback_data($data, $order, $validation = false)
786786
787787 $history[$data['uuid']] = [
788788 'timestamp' => time(),
789- 'value_paid' => CryptAPI\Helper::sig_fig($paid, 6 ),
789+ 'value_paid' => CryptAPI\Helper::sig_fig($paid, 8 ),
790790 'value_paid_fiat' => $conversion[strtoupper($order->get_currency())],
791791 'pending' => $data['pending']
792792 ];
@@ -1262,14 +1262,14 @@ function calc_order($history, $total, $total_fiat)
12621262 if (!empty($history)) {
12631263 foreach ($history as $uuid => $item) {
12641264 if ((int)$item['pending'] === 0) {
1265- $remaining = bcsub(CryptAPI\Helper::sig_fig($remaining, 6 ), $item['value_paid'], 8);
1265+ $remaining = bcsub(CryptAPI\Helper::sig_fig($remaining, 8 ), $item['value_paid'], 8);
12661266 }
12671267
1268- $remaining_pending = bcsub(CryptAPI\Helper::sig_fig($remaining_pending, 6 ), $item['value_paid'], 8);
1269- $remaining_fiat = bcsub(CryptAPI\Helper::sig_fig($remaining_fiat, 6 ), $item['value_paid_fiat'], 8);
1268+ $remaining_pending = bcsub(CryptAPI\Helper::sig_fig($remaining_pending, 8 ), $item['value_paid'], 8);
1269+ $remaining_fiat = bcsub(CryptAPI\Helper::sig_fig($remaining_fiat, 8 ), $item['value_paid_fiat'], 8);
12701270
1271- $already_paid = bcadd(CryptAPI\Helper::sig_fig($already_paid, 6 ), $item['value_paid'], 8);
1272- $already_paid_fiat = bcadd(CryptAPI\Helper::sig_fig($already_paid_fiat, 6 ), $item['value_paid_fiat'], 8);
1271+ $already_paid = bcadd(CryptAPI\Helper::sig_fig($already_paid, 8 ), $item['value_paid'], 8);
1272+ $already_paid_fiat = bcadd(CryptAPI\Helper::sig_fig($already_paid_fiat, 8 ), $item['value_paid_fiat'], 8);
12731273 }
12741274 }
12751275
@@ -1584,7 +1584,7 @@ function refresh_value($order)
15841584 $cryptapi_coin = $order->get_meta('cryptapi_currency');
15851585
15861586 $crypto_conversion = (float)CryptAPI\Helper::get_conversion($woocommerce_currency, $cryptapi_coin, $order_total, $this->disable_conversion);
1587- $crypto_total = CryptAPI\Helper::sig_fig($crypto_conversion, 6 );
1587+ $crypto_total = CryptAPI\Helper::sig_fig($crypto_conversion, 8 );
15881588 $order->update_meta_data('cryptapi_total', $crypto_total);
15891589
15901590 $calc_cron = $this->calc_order($history, $crypto_total, $order_total);
0 commit comments