Skip to content

Commit 286eae7

Browse files
committed
v4.8.5
- Minor bugfixes
1 parent b590cf6 commit 286eae7

File tree

6 files changed

+21
-15
lines changed

6 files changed

+21
-15
lines changed

CryptAPI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: CryptAPI Payment Gateway for WooCommerce
44
Plugin URI: https://github.com/cryptapi/woocommerce-cryptapi
55
Description: Accept cryptocurrency payments on your WooCommerce website
6-
Version: 4.8.4
6+
Version: 4.8.5
77
Requires at least: 5.8
88
Tested up to: 6.5.3
99
WC requires at least: 5.8

README.md

100755100644
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
379379
#### 4.8.4
380380
* Minor improvements
381381

382+
#### 4.8.5
383+
* Minor improvements
384+
382385
### Upgrade Notice
383386
#### 4.3
384387
* Please be sure to enable the PHP extension BCMath before upgrading to this version.

controllers/CryptAPI.php

100755100644
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -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);

define.php

100755100644
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?php
22

3-
define('CRYPTAPI_PLUGIN_VERSION', '4.8.4');
3+
define('CRYPTAPI_PLUGIN_VERSION', '4.8.5');
44
define('CRYPTAPI_PLUGIN_PATH', plugin_dir_path(__FILE__));
55
define('CRYPTAPI_PLUGIN_URL', plugin_dir_url(__FILE__));

emails/renewal-email.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616
)
1717
),
1818
esc_html( get_bloginfo( 'name', 'display' ) ),
19-
'<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a>'
19+
'<div style="text-align:center; margin-bottom: 30px;"><a style="display:block;text-align:center;margin: 40px auto; font-size: 16px; font-weight: bold;" href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order', 'woocommerce' ) . '</a></div>'
2020
);
2121
/*
2222
* @hooked WC_Emails::email_footer() Output the email footer
2323
*/
24-
do_action( 'woocommerce_email_footer', $email );
24+
do_action( 'woocommerce_email_footer', $email );

readme.txt

100755100644
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Contributors: cryptapi
33
Tags: crypto payments, woocommerce, payment gateway, crypto, payment, pay with crypto, payment request, bitcoin, bnb, usdt, ethereum, litecoin, bitcoin cash, shib, doge
44
Requires at least: 5.8
55
Tested up to: 6.5
6-
Stable tag: 4.8.4
6+
Stable tag: 4.8.5
77
Requires PHP: 7.2
88
WC requires at least: 5.8
99
WC tested up to: 9.0.1
@@ -377,6 +377,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
377377
= 4.8.4 =
378378
* Minor improvements
379379

380+
= 4.8.5 =
381+
* Minor improvements
382+
380383
== Upgrade Notice ==
381384

382385
= 4.3 =

0 commit comments

Comments
 (0)