Skip to content

Commit 2e7f0f0

Browse files
author
Ariano Fonseca Ângelo
committed
v4.6.3
- Minor fixes
1 parent 5144189 commit 2e7f0f0

File tree

6 files changed

+30
-11
lines changed

6 files changed

+30
-11
lines changed

CryptAPI.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
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.6.2
6+
Version: 4.6.3
77
Requires at least: 5
88
Tested up to: 6.0.2
99
WC requires at least: 5.8
10-
WC tested up to: 6.9.3
10+
WC tested up to: 6.9.4
1111
Requires PHP: 7.2
1212
Author: cryptapi
1313
Author URI: https://cryptapi.io/

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
279279
* Minor fixes
280280
* Added new languages
281281

282+
#### 4.6.3
283+
* Minor fixes
284+
282285
### Upgrade Notice
283286
#### 4.3
284287
* Please be sure to enable the PHP extension BCMath before upgrading to this version.

controllers/CryptAPI.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -619,13 +619,20 @@ function order_status()
619619
$remaining_pending = $calc['remaining_pending'];
620620
$remaining_fiat = $calc['remaining_fiat'];
621621

622+
$hide_refresh = 0;
623+
622624
$cryptapi_pending = 0;
625+
626+
$counter_calc = (int)$order->get_meta('cryptapi_last_price_update') + (int)$this->refresh_value_interval - time();
627+
628+
if($already_paid > 0) {
629+
$hide_refresh = 1;
630+
}
631+
623632
if ($remaining_pending <= 0 && !$order->is_paid()) {
624633
$cryptapi_pending = 1;
625634
}
626635

627-
$counter_calc = (int)$order->get_meta('cryptapi_last_price_update') + (int)$this->refresh_value_interval - time();
628-
629636
if ($counter_calc <= 0 && !$order->is_paid()) {
630637
$this->ca_cronjob();
631638
}
@@ -653,7 +660,8 @@ function order_status()
653660
'remaining' => $remaining_pending <= 0 ? 0 : $remaining_pending,
654661
'fiat_remaining' => $remaining_fiat <= 0 ? 0 : $remaining_fiat,
655662
'already_paid_fiat' => floatval($already_paid_fiat) <= 0 ? 0 : floatval($already_paid_fiat),
656-
'fiat_symbol' => get_woocommerce_currency_symbol()
663+
'fiat_symbol' => get_woocommerce_currency_symbol(),
664+
'hide_refresh' => $hide_refresh,
657665
];
658666

659667
echo json_encode($data);
@@ -676,8 +684,7 @@ function validate_logs($order, $history)
676684
$request_url = parse_url($logs[0]->request_url);
677685
parse_str($request_url['query'], $data);
678686

679-
if (empty($history[$callback->uuid]) || (!empty($history[$callback->uuid]) && (int)$data['pending'] === 0)) {
680-
687+
if (empty($history[$callback->uuid]) || (!empty($history[$callback->uuid]) && (int)$history[$callback->uuid]['pending'] === 1 && (int)$data['pending'] === 0)) {
681688
$this->process_callback_data($data, $order, true);
682689
}
683690
}
@@ -1120,7 +1127,7 @@ function ca_cronjob()
11201127
}
11211128

11221129
if ($value_refresh !== 0 && $last_price_update + $value_refresh <= time() && !empty($last_price_update)) {
1123-
if ($remaining === $remaining_pending) {
1130+
if ($already_paid === 0) {
11241131
$cryptapi_coin = $order->get_meta('cryptapi_currency');
11251132

11261133
$crypto_total = CryptAPI\Helper::sig_fig(CryptAPI\Helper::get_conversion($woocommerce_currency, $cryptapi_coin, $order->get_total('edit'), $this->disable_conversion), 6);

define.php

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.6.2');
3+
define('CRYPTAPI_PLUGIN_VERSION', '4.6.3');
44
define('CRYPTAPI_PLUGIN_PATH', plugin_dir_path(__FILE__));
55
define('CRYPTAPI_PLUGIN_URL', plugin_dir_url(__FILE__));

readme.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ Contributors: cryptapi
33
Tags: crypto payments, woocommerce, payment gateway, crypto, payment, pay with crypto, payment request, bitcoin, bnb, usdt, ethereum, monero, litecoin, bitcoin cash, shib, doge
44
Requires at least: 5
55
Tested up to: 6.0.2
6-
Stable tag: 4.6.2
6+
Stable tag: 4.6.3
77
Requires PHP: 7.2
88
WC requires at least: 5.8
9-
WC tested up to: 6.9.3
9+
WC tested up to: 6.9.4
1010
License: MIT
1111

1212
Accept cryptocurrency payments on your WooCommerce website
@@ -289,6 +289,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
289289
* Minor fixes
290290
* Added new languages
291291

292+
= 4.6.3 =
293+
* Minor fixes
294+
292295
== Upgrade Notice ==
293296

294297
= 4.3 =

static/payment.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ function check_status(ajax_url) {
6161
jQuery('.ca_notification_remaining').hide();
6262
}
6363

64+
if (data.hide_refresh === 1) {
65+
jQuery('.ca_time_refresh').hide();
66+
} else {
67+
jQuery('.ca_time_refresh').show();
68+
}
69+
6470
if (data.remaining !== data.crypto_total) {
6571
jQuery('.ca_notification_payment_received').show();
6672
jQuery('.ca_notification_cancel').remove();

0 commit comments

Comments
 (0)