Skip to content

Commit 622d82b

Browse files
committed
v4.8.2
* Minor fixes and improvements
1 parent 2d97050 commit 622d82b

File tree

5 files changed

+41
-8
lines changed

5 files changed

+41
-8
lines changed

CryptAPI.php

Lines changed: 3 additions & 3 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.8.1
6+
Version: 4.8.2
77
Requires at least: 5.8
8-
Tested up to: 6.5
8+
Tested up to: 6.5.3
99
WC requires at least: 5.8
10-
WC tested up to: 8.6.1
10+
WC tested up to: 8.9.1
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
@@ -370,6 +370,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
370370
#### 4.8.1
371371
* Minor fixes and improvements
372372

373+
#### 4.8.2
374+
* Minor fixes and improvements
375+
373376
### Upgrade Notice
374377
#### 4.3
375378
* Please be sure to enable the PHP extension BCMath before upgrading to this version.

controllers/CryptAPI.php

Lines changed: 27 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,11 @@ function load_coins()
7373

7474
$coins = CryptAPI\Helper::get_supported_coins();
7575
set_transient('cryptapi_coins', $coins, 86400);
76+
77+
if (empty($coins)) {
78+
throw new Exception(__('No cryptocurrencies available at the moment. Please choose a different payment method or try again later.', 'cryptapi'));
79+
}
80+
7681
return $coins;
7782
}
7883

@@ -174,7 +179,12 @@ function admin_options()
174179

175180
private function ca_settings()
176181
{
177-
$load_coins = $this->load_coins();
182+
$load_coins = [];
183+
try {
184+
$load_coins = $this->load_coins();
185+
} catch (Exception $e) {
186+
//
187+
}
178188

179189
$this->enabled = $this->get_option('enabled');
180190
$this->title = $this->get_option('title');
@@ -204,7 +214,12 @@ private function ca_settings()
204214

205215
function init_form_fields()
206216
{
207-
$load_coins = $this->load_coins();
217+
$load_coins = [];
218+
try {
219+
$load_coins = $this->load_coins();
220+
} catch (Exception $e) {
221+
//
222+
}
208223

209224
if (!empty($load_coins)) {
210225
$this->form_fields = array(
@@ -414,7 +429,16 @@ public function get_icon()
414429

415430
function payment_fields()
416431
{
417-
$load_coins = $this->load_coins();
432+
try {
433+
$load_coins = $this->load_coins();
434+
} catch (Exception $e) {
435+
?>
436+
<div class="woocommerce-error">
437+
<?php echo __('Sorry, there has been an error.', 'woocommerce'); ?>
438+
</div>
439+
<?php
440+
return;
441+
}
418442
?>
419443
<div class="form-row form-row-wide">
420444
<p><?php echo esc_attr($this->description); ?></p>

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

readme.txt

Lines changed: 7 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.1
6+
Stable tag: 4.8.2
77
Requires PHP: 7.2
88
WC requires at least: 5.8
99
WC tested up to: 8.6.1
@@ -365,6 +365,12 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
365365
= 4.8.0 =
366366
* Support for new languages: German, French, Ukrainian, Russian and Chinese.
367367

368+
= 4.8.1 =
369+
* Minor fixes and improvements
370+
371+
= 4.8.2 =
372+
* Minor fixes and improvements
373+
368374
== Upgrade Notice ==
369375

370376
= 4.3 =

0 commit comments

Comments
 (0)