Skip to content

Commit d0b62df

Browse files
author
Ariano Fonseca Ângelo
committed
v4.6.1
- Minor fixes
1 parent 61ed208 commit d0b62df

File tree

6 files changed

+18
-8
lines changed

6 files changed

+18
-8
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
wp-cli.phar

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

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
271271
* New BlockBee API Url
272272
* Minor fixes
273273

274+
#### 4.6.1
275+
* Minor fixes
276+
274277
### Upgrade Notice
275278
#### 4.3
276279
* Please be sure to enable the PHP extension BCMath before upgrading to this version.

controllers/CryptAPI.php

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ function init_form_fields()
321321
'order_cancelation_timeout' => array(
322322
'title' => __('Order cancelation timeout', 'cryptapi'),
323323
'type' => 'select',
324-
'default' => '3600',
324+
'default' => '0',
325325
'options' => array(
326326
'0' => __('Never', 'cryptapi'),
327327
'3600' => __('1 Hour', 'cryptapi'),
@@ -622,14 +622,17 @@ function validate_payment()
622622
if ($remaining <= 0) {
623623
$order->payment_complete($data['address_in']);
624624
if ($this->virtual_complete) {
625-
$is_virtual = false;
625+
$count_products = count($order->get_items());
626+
$count_virtual = 0;
626627
foreach ($order->get_items() as $order_item) {
627628
$item = wc_get_product($order_item->get_product_id());
628-
if ($item->is_virtual()) {
629-
$is_virtual = true;
629+
$item_obj = $item->get_type() === 'variable' ? wc_get_product($order_item['variation_id']) : $item;
630+
631+
if ($item_obj->is_virtual()) {
632+
$count_virtual += 1;
630633
}
631634
}
632-
if ($is_virtual) {
635+
if ($count_virtual === $count_products) {
633636
$order->update_status('completed');
634637
}
635638
}

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.6.0');
3+
define('CRYPTAPI_PLUGIN_VERSION', '4.6.1');
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.2
6-
Stable tag: 4.6.0
6+
Stable tag: 4.6.1
77
Requires PHP: 7.2
88
WC requires at least: 5.8
99
WC tested up to: 6.8.0
@@ -281,6 +281,9 @@ The easiest and fastest way is via our live chat on our [website](https://crypta
281281
* New BlockBee API Url
282282
* Minor fixes
283283

284+
= 4.6.1 =
285+
* Minor fixes
286+
284287
== Upgrade Notice ==
285288

286289
= 4.3 =

0 commit comments

Comments
 (0)