Skip to content

Commit 31f2285

Browse files
author
olxndr
committed
Changed obtaining crypto list
1 parent 4b76d99 commit 31f2285

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

shkeeper/includes/class-shkeeper-api.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Shkeeper_API {
99
public static function getCryptosList($endpoint = '/crypto') {
1010
$cryptos = self::request($endpoint, '', 'GET');
1111
if($cryptos->status == 'success' && $cryptos->crypto) {
12-
return $cryptos->crypto;
12+
return $cryptos->crypto_list ?? $cryptos->crypto;
1313
}
1414

1515
Shkeeper_Logger::log(

shkeeper/includes/shkeeper-checkout-description.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,12 @@ function shkeeper_add_custom_checkout_description($description, $payment_id) {
2323
'none' => esc_html__( 'Select Cryptocurrency', 'shkeeper-payment-gateway' ),
2424
];
2525
foreach ($available_cryptos as $available_crypto) {
26-
$cryptos_options[$available_crypto] = wc_strtoupper($available_crypto);
26+
if(is_object($available_crypto) && $available_crypto->display_name) {
27+
$cryptos_options[$available_crypto->name] = $available_crypto->display_name;
28+
} else {
29+
//Shkeeper versions <v1.1.3 compatibility
30+
$cryptos_options[$available_crypto] = wc_strtoupper($available_crypto);
31+
}
2732
}
2833

2934
ob_start();

shkeeper/shkeeper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* Author URI: https://vsys.host/
88
* License: GPLv3
99
* License URI: https://www.gnu.org/licenses/gpl-3.0.en.html
10-
* Stable tag: 1.1.1
11-
* Version: 1.1.1
10+
* Stable tag: 1.1.2
11+
* Version: 1.1.2
1212
* WC requires at least: 5.7
1313
* WC tested up to: 9.9.5
1414
* Text Domain: shkeeper-payment-gateway
@@ -19,7 +19,7 @@
1919
exit;
2020
}
2121

22-
define( 'SHKEEPER_WC_VERSION', '1.1.1' );
22+
define( 'SHKEEPER_WC_VERSION', '1.1.2' );
2323
define( 'SHKEEPER_WC_MAIN_FILE', __FILE__ );
2424

2525
if ( ! in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) return;

0 commit comments

Comments
 (0)