Skip to content

Commit 6fdb9f5

Browse files
author
Ariano Fonseca Ângelo
committed
v4.5.2
- Minor fixes
1 parent 98dab9b commit 6fdb9f5

5 files changed

Lines changed: 26 additions & 18 deletions

File tree

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.5.1
6+
Version: 4.5.2
77
Requires at least: 5
88
Tested up to: 6.0.1
99
WC requires at least: 5.8

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
264264
#### 4.5.1
265265
* Minor fixes
266266

267+
#### 4.5.2
268+
* Minor fixes
269+
267270
### Upgrade Notice
268271
#### 4.3
269272
* Please be sure to enable the PHP extension BCMath before upgrading to this version.

controllers/CryptAPI.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ function init_form_fields()
359359
$this->form_fields["{$ticker}_address"] = array(
360360
'title' => is_array($coin) ? $coin['name'] : $coin,
361361
'type' => 'cryptocurrency',
362-
'description' => sprintf($coin_description, $coin),
362+
'description' => sprintf($coin_description, is_array($coin) ? $coin['name'] : $coin),
363363
'desc_tip' => true,
364364
'custom_attributes' => array(
365365
'counter' => $c++,
@@ -428,20 +428,22 @@ function payment_fields()
428428
</ul>
429429
</div>
430430
<script>
431-
jQuery('#payment_cryptapi_coin').selectWoo({
432-
minimumResultsForSearch: -1,
433-
templateResult: formatState,
434-
});
435-
436-
function formatState(opt) {
437-
if (!opt.id) {
438-
return opt.text;
439-
}
440-
let optImage = jQuery(opt.element).attr('data-image');
441-
if (!optImage) {
442-
return opt.text;
443-
} else {
444-
return jQuery('<span style="display:flex; align-items:center;"><img style="margin-right: 8px" src="' + optImage + '" width="24px" alt="' + opt.text + '" /> ' + opt.text + '</span>');
431+
if(typeof jQuery.fn.selectWoo !== 'undefined') {
432+
jQuery('#payment_cryptapi_coin').selectWoo({
433+
minimumResultsForSearch: -1,
434+
templateResult: formatState,
435+
});
436+
437+
function formatState(opt) {
438+
if (!opt.id) {
439+
return opt.text;
440+
}
441+
let optImage = jQuery(opt.element).attr('data-image');
442+
if (!optImage) {
443+
return opt.text;
444+
} else {
445+
return jQuery('<span style="display:flex; align-items:center;"><img style="margin-right: 8px" src="' + optImage + '" width="24px" alt="' + opt.text + '" /> ' + opt.text + '</span>');
446+
}
445447
}
446448
}
447449
</script>

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

readme.txt

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, monero, litecoin, bitcoin cash, shib, doge
44
Requires at least: 5
55
Tested up to: 6.0.1
6-
Stable tag: 4.5.1
6+
Stable tag: 4.5.2
77
Requires PHP: 7.2
88
WC requires at least: 5.8
99
WC tested up to: 6.8.0
@@ -274,6 +274,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
274274
= 4.5.1 =
275275
* Minor fixes
276276

277+
= 4.5.2 =
278+
* Minor fixes
279+
277280
== Upgrade Notice ==
278281

279282
= 4.3 =

0 commit comments

Comments
 (0)