diff --git a/paymentGateway/cardano/class-sargapay-gateway.php b/paymentGateway/cardano/class-sargapay-gateway.php
index 3588541..423cf8f 100644
--- a/paymentGateway/cardano/class-sargapay-gateway.php
+++ b/paymentGateway/cardano/class-sargapay-gateway.php
@@ -278,8 +278,8 @@ private function getCurrency()
$result->currency = get_woocommerce_currency();
$result->symbol = get_woocommerce_currency_symbol();
} else {
- $currency = $this->currency;
- switch ($currency) {
+ $result->currency = $this->currency;
+ switch ($result->currency) {
case "ADA":
$result->symbol = "₳";
break;
@@ -304,7 +304,7 @@ public function payment_fields()
$request = wp_remote_retrieve_body(wp_remote_get('https://api.coingecko.com/api/v3/simple/price?ids=cardano&vs_currencies=' . $currency));
$data = json_decode($request, true);
}
- if ($currency === "ADA" || count($data) == 1) {
+ if ($currency === "ADA" || count($data['cardano']) == 1) {
if ($this->testmode) {
?>
@@ -443,7 +443,7 @@ public function process_payment($order_id)
WC()->cart->empty_cart();
return array(
'result' => 'failure',
- 'redirect' => WC()->cart->get_checkout_url()
+ 'redirect' => wc_get_checkout_url()
);
}
diff --git a/readme.txt b/readme.txt
index 58b20d1..9411ea2 100644
--- a/readme.txt
+++ b/readme.txt
@@ -4,7 +4,7 @@ Donate link: https://sargatxet.cloud/
Tags: paymentGateway, Crypto, Cardano
Requires at least: 4.7
Tested up to: 6.1
-Stable tag: 2.1.0
+Stable tag: 2.1.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -68,6 +68,9 @@ Finally we have to activate the plugin and verify the network that we are going
== Changelog ==
+= 2.1.1 =
+* Fixed issue where the total value displayed as 0 when the default currency was set to ADA
+
= 2.1 =
* Add Cardano Currency to WooCommerce
* Fix markup error
diff --git a/sargapay.php b/sargapay.php
index 59fe023..2f7578b 100644
--- a/sargapay.php
+++ b/sargapay.php
@@ -16,7 +16,7 @@
* Plugin Name: Sargapay
* Plugin URI: https://sargatxet.cloud/sargapay-cardano/
* Description: WordPress payment gateway for crypto.
- * Version: 2.1.0
+ * Version: 2.1.1
* Author: Sargatxet
* Author URI: https://sargatxet.cloud/
* License: GPLv2 or later
@@ -58,7 +58,7 @@
define('SARGAPAY_PATH', plugin_dir_path(__FILE__));
define('SARGAPAY_URL', plugin_dir_url(__FILE__));
-define('SARGAPAY_VERSION', '2.1.0');
+define('SARGAPAY_VERSION', '2.1.1');
add_filter('cron_schedules', 'sargapay_cron_hook');
add_action('sargapay_cron_hook', 'sargapay_check_confirmations_cardano');