Skip to content

Commit 045b98c

Browse files
author
Ariano Ângelo
committed
4.0.2
1 parent b8da067 commit 045b98c

5 files changed

Lines changed: 35 additions & 24 deletions

File tree

CryptAPI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Plugin Name: CryptAPI Payment Gateway for WooCommerce
55
Plugin URI: https://github.com/cryptapi/woocommerce-cryptapi
66
Description: Accept cryptocurrency payments on your WooCommerce website
7-
Version: 4.0.1
7+
Version: 4.0.2
88
Requires at least: 4.0
99
Tested up to: 5.9
1010
WC requires at least: 2.4

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,8 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
181181
#### 4.0.1
182182
* Minor fixes
183183

184+
#### 4.0.2
185+
* Minor fixes
186+
184187
### Upgrade Notice
185188
* No breaking changes

controllers/CryptAPI.php

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -227,23 +227,26 @@ function init_form_fields()
227227
'type' => 'select',
228228
'default' => 'none',
229229
'options' => array(
230-
'0.5' => '5%',
231-
'0.4' => '4%',
232-
'0.3' => '3%',
233-
'0.2' => '2%',
234-
'0.1' => '1%',
235-
'0.090' => '0.90%',
236-
'0.085' => '0.85%',
237-
'0.080' => '0.80%',
238-
'0.075' => '0.75%',
239-
'0.070' => '0.70%',
240-
'0.065' => '0.65%',
241-
'0.060' => '0.60%',
242-
'0.055' => '0.55%',
243-
'0.050' => '0.50%',
244-
'0.040' => '0.40%',
245-
'0.030' => '0.30%',
246-
'0.025' => '0.25%',
230+
'0.05' => '5%',
231+
'0.04' => '4%',
232+
'0.03' => '3%',
233+
'0.02' => '2%',
234+
'0.018' => '1.8%',
235+
'0.015' => '1.5%',
236+
'0.012' => '1.2%',
237+
'0.01' => '1%',
238+
'0.0090' => '0.90%',
239+
'0.0085' => '0.85%',
240+
'0.0080' => '0.80%',
241+
'0.0075' => '0.75%',
242+
'0.0070' => '0.70%',
243+
'0.0065' => '0.65%',
244+
'0.0060' => '0.60%',
245+
'0.0055' => '0.55%',
246+
'0.0050' => '0.50%',
247+
'0.0040' => '0.40%',
248+
'0.0030' => '0.30%',
249+
'0.0025' => '0.25%',
247250
'none' => '0%',
248251
),
249252
'description' => __('Set the CryptAPI service fee you want to charge the costumer.<br><strong>Note: </strong>Fee you want to charge your costumers (to cover CryptAPI\'s fees fully or partially)</strong>', 'cryptapi')
@@ -975,9 +978,11 @@ function handling_fee()
975978
return;
976979
}
977980

981+
978982
$total_fee = $this->get_option('fee_order_percentage') == 'none' ? 0 : $this->get_option('fee_order_percentage');
979983

980-
$fee_order = $this->get_option('add_blockchain_fee');
984+
985+
$fee_order = WC()->cart->subtotal * $total_fee;
981986

982987
if ($fee_order) {
983988

@@ -990,14 +995,14 @@ function handling_fee()
990995
if (!empty($selected) && $selected != 'none') {
991996
$est = CryptAPI\Helper::get_estimate($selected);
992997

993-
$total_fee += (float)$est->{get_woocommerce_currency()};
998+
$fee_order += (float)$est->{get_woocommerce_currency()};
994999
}
9951000

996-
if (empty($total_fee)) {
1001+
if (empty($fee_order)) {
9971002
return;
9981003
}
9991004

1000-
WC()->cart->add_fee(__('Service Fee', 'cryptapi'), $total_fee, true);
1005+
WC()->cart->add_fee(__('Service Fee', 'cryptapi'), $fee_order, true);
10011006
}
10021007
}
10031008

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.0.1');
3+
define('CRYPTAPI_PLUGIN_VERSION', '4.0.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: 4.4
55
Tested up to: 5.9
6-
Stable tag: 4.0.1
6+
Stable tag: 4.0.2
77
Requires PHP: 5.5
88
WC requires at least: 2.4
99
WC tested up to: 6.2
@@ -195,5 +195,8 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
195195
= 4.0.1 =
196196
* Minor fixes
197197

198+
= 4.0.2 =
199+
* Minor fixes
200+
198201
== Upgrade Notice ==
199202
* No breaking changes

0 commit comments

Comments
 (0)