Skip to content

Commit 505f7a8

Browse files
authored
Merge pull request #117 from AltaPay/remove-orderline-restriciton
Remove restriction on order lines when placing an order.
2 parents 85f2573 + 06df9ef commit 505f7a8

5 files changed

Lines changed: 12 additions & 15 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [3.7.8]
5+
- Fix: Remove restriction on order lines when placing an order.
6+
47
## [3.7.7]
58
- Fix: Apple Pay - Incorrect transaction amounts with custom currency configurations.
69

altapay.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Author URI: https://altapay.com
88
* Text Domain: altapay
99
* Domain Path: /languages
10-
* Version: 3.7.7
10+
* Version: 3.7.8
1111
* Name: SDM_Altapay
1212
* WC requires at least: 3.9.0
1313
* WC tested up to: 9.7.1
@@ -41,7 +41,7 @@
4141
}
4242

4343
if ( ! defined( 'ALTAPAY_PLUGIN_VERSION' ) ) {
44-
define( 'ALTAPAY_PLUGIN_VERSION', '3.7.7' );
44+
define( 'ALTAPAY_PLUGIN_VERSION', '3.7.8' );
4545
}
4646

4747
// Include the autoloader, so we can dynamically include the rest of the classes.

classes/util/UtilMethods.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
namespace Altapay\Classes\Util;
1111

12-
use WC_Coupon;
13-
use WP_Error;
1412
use Altapay\Request\OrderLine;
1513

1614
class UtilMethods {
@@ -39,11 +37,6 @@ public function createOrderLines( $order, $products = array(), $wcRefund = false
3937
$cartItems = $itemsToCapture;
4038
}
4139

42-
// if cart is empty
43-
if ( ! $cartItems ) {
44-
return new WP_Error( 'error', __( 'There are no items in the cart ', 'altapay' ) );
45-
}
46-
4740
$i = 0;
4841

4942
// generate order lines product by product

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: AltaPay, Gateway, Payments, WooCommerce, Payment Card Industry
44
Requires PHP: 7.4
55
Requires at least: 5.0
66
Tested up to: 6.7.2
7-
Stable tag: 3.7.7
7+
Stable tag: 3.7.8
88
License: MIT
99
WC requires at least: 3.9.0
1010
WC tested up to: 9.7.1
@@ -39,6 +39,9 @@ AltaPay's Payment Gateway for WooCommerce provides merchants with access to a fu
3939

4040
== Changelog ==
4141

42+
= 3.7.8 =
43+
* Fix: Remove restriction on order lines when placing an order.
44+
4245
= 3.7.7 =
4346
* Fix: Apple Pay - Incorrect transaction amounts with custom currency configurations.
4447

views/paymentClass.tpl

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,10 @@ class WC_Gateway_{key} extends WC_Payment_Gateway {
304304
'subscription',
305305
'subscriptionAndCharge'
306306
] ) );
307-
if ( $orderLines instanceof WP_Error ) {
308-
return $orderLines; // Some error occurred
309-
}
310-
311-
$request->setOrderLines( $orderLines );
312307

308+
if ( $orderLines ) {
309+
$request->setOrderLines( $orderLines );
310+
}
313311

314312
if ( $request ) {
315313
try {

0 commit comments

Comments
 (0)