Skip to content

Commit

Permalink
Release 3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
edgaraswallee committed Apr 3, 2024
1 parent cc304e4 commit 4c10b24
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 64 deletions.
7 changes: 0 additions & 7 deletions changelog.txt
Expand Up @@ -727,10 +727,3 @@ Tested against:
- [Tested Against] Woocommerce 8.5.2
- [Tested Against] PHP SDK 4.0.2

= 3.0.1 - April 3 2024 =
- [Feature] Added support to High Performance Order Storage (HPOS).
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.5
- [Tested Against] Woocommerce 8.7.0
- [Tested Against] PHP SDK 4.0.2

51 changes: 33 additions & 18 deletions includes/admin/class-wc-wallee-admin-document.php
Expand Up @@ -113,35 +113,50 @@ public static function add_buttons_to_overview( WC_Order $order ) {

/**
* Add WC Meta boxes.
* @see: https://woo.com/document/high-performance-order-storage/#section-8
*/
public static function add_meta_box() {
$screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' )
&& wc_get_container()->get( \Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled()
? wc_get_page_screen_id( 'shop-order' )
: 'shop_order';
add_meta_box(
'woocommerce-order-wallee-documents',
__( 'wallee Documents', 'woo-wallee' ),
global $post;
if ( 'shop_order' !== $post->post_type ) {
return;
}
$order = WC_Order_Factory::get_order( $post->ID );
$method = wc_get_payment_gateway_by_order( $order );
if ( ! ( $method instanceof WC_Wallee_Gateway ) ) {
return;
}
$transaction_info = WC_Wallee_Entity_Transaction_Info::load_by_order_id( $order->get_id() );
if ( $transaction_info->get_id() !== null && in_array(
$transaction_info->get_state(),
array(
__CLASS__,
'output',
\Wallee\Sdk\Model\TransactionState::COMPLETED,
\Wallee\Sdk\Model\TransactionState::FULFILL,
\Wallee\Sdk\Model\TransactionState::DECLINE,
),
$screen,
'side',
'default'
);
true
) ) {
add_meta_box(
'woocommerce-order-wallee-documents',
__( 'wallee Documents', 'woo-wallee' ),
array(
__CLASS__,
'output',
),
'shop_order',
'side',
'default'
);
}
}

/**
* Output the metabox.
*
* @param WP_Post|WP_Order $post_or_order_object
* This object is provided by woocommerce when using its screen.
* @param WP_Post $post Post.
*/
public static function output( $post_or_order_object ) {
$order = ( $post_or_order_object instanceof WP_Post ) ? wc_get_order( $post_or_order_object->ID ) : $post_or_order_object;
public static function output( $post ) {
global $post;

$order = WC_Order_Factory::get_order( $post->ID );
$method = wc_get_payment_gateway_by_order( $order );
if ( ! ( $method instanceof WC_Wallee_Gateway ) ) {
return;
Expand Down
56 changes: 33 additions & 23 deletions includes/admin/class-wc-wallee-admin-transaction.php
Expand Up @@ -41,35 +41,45 @@ public static function init() {

/**
* Add WC Meta boxes.
* @see: https://woo.com/document/high-performance-order-storage/#section-8
*/
public static function add_meta_box() {
$screen = class_exists( '\Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController' )
&& wc_get_container()->get( \Automattic\WooCommerce\Internal\DataStores\Orders\CustomOrdersTableController::class )->custom_orders_table_usage_is_enabled()
? wc_get_page_screen_id( 'shop-order' )
: 'shop_order';
add_meta_box(
'woocommerce-order-wallee-transaction',
__( 'wallee Transaction', 'woocommerce-wallee' ),
array(
__CLASS__,
'output',
),
$screen,
'normal',
'default'
);
global $post;
if ( 'shop_order' != $post->post_type ) {
return;
}
$order = WC_Order_Factory::get_order( $post->ID );
$method = wc_get_payment_gateway_by_order( $order );
if ( ! ( $method instanceof WC_Wallee_Gateway ) ) {
return;
}
$transaction_info = WC_Wallee_Entity_Transaction_Info::load_by_order_id( $order->get_id() );
if ( $transaction_info->get_id() == null ) {
$transaction_info = WC_Wallee_Entity_Transaction_Info::load_newest_by_mapped_order_id( $order->get_id() );
}
if ( $transaction_info->get_id() != null ) {
add_meta_box(
'woocommerce-order-wallee-transaction',
__( 'wallee Transaction', 'woocommerc-wallee' ),
array(
__CLASS__,
'output',
),
'shop_order',
'normal',
'default'
);
}
}

/**
* Output the metabox.
*
* @param WP_Post|WP_Order $post_or_order_object
* This object is provided by woocommerce when using its screen.
* @param WP_Post $post post data.
*/
public static function output( $post_or_order_object ) {
$order = ( $post_or_order_object instanceof WP_Post ) ? wc_get_order( $post_or_order_object->ID ) : $post_or_order_object;
public static function output( $post ) {
global $post;

$order = WC_Order_Factory::get_order( $post->ID );
$method = wc_get_payment_gateway_by_order( $order );
if ( ! ( $method instanceof WC_Wallee_Gateway ) ) {
return;
Expand Down Expand Up @@ -119,7 +129,7 @@ public static function output( $post_or_order_object ) {
<td class="value"><strong><?php esc_html_e( $transaction_info->get_order_id() ); ?></strong></td>
</tr>
<?php endif; ?>

<?php if ( $transaction_info->get_failure_reason() != null ) : ?>
<tr>
<td class="label"><label><?php esc_html_e( 'Failure Reason', 'woo-wallee' ); ?></label></td>
Expand All @@ -145,7 +155,7 @@ public static function output( $post_or_order_object ) {
</tbody>
</table>
</div>


<?php if ( ! empty( $labels_by_group ) ) : ?>
<?php foreach ( $labels_by_group as $group ) : ?>
Expand All @@ -167,7 +177,7 @@ public static function output( $post_or_order_object ) {
</table>
</div>
</div>

<?php endforeach; ?>
<?php endif; ?>
</div>
Expand Down
12 changes: 6 additions & 6 deletions readme.txt
Expand Up @@ -3,7 +3,7 @@ Contributors: wallee AG
Tags: woocommerce wallee, woocommerce, wallee, payment, e-commerce, webshop, psp, invoice, packing slips, pdf, customer invoice, processing
Requires at least: 4.7
Tested up to: 6.2
Stable tag: 3.0.1
Stable tag: 3.0.0
License: Apache 2
License URI: http://www.apache.org/licenses/LICENSE-2.0

Expand Down Expand Up @@ -56,9 +56,9 @@ Support queries can be issued on the [wallee support site](https://app-wallee.co
== Changelog ==


= 3.0.1 - April 3 2024 =
- [Feature] Added support to High Performance Order Storage (HPOS).
- [Tested Against] PHP 8.2
- [Tested Against] Wordpress 6.5
- [Tested Against] Woocommerce 8.7.0
= 3.0.0 - February 20 2024 =
- [Feature] Full version release
- [Tested Against] PHP 8.0
- [Tested Against] Wordpress 6.4.3
- [Tested Against] Woocommerce 8.5.2
- [Tested Against] PHP SDK 4.0.2
17 changes: 7 additions & 10 deletions woocommerce-wallee.php
Expand Up @@ -3,10 +3,15 @@
* Plugin Name: wallee
* Plugin URI: https://wordpress.org/plugins/woo-wallee
* Description: Process WooCommerce payments with wallee.
* Version: 3.0.0
* License: Apache2
* License URI: http://www.apache.org/licenses/LICENSE-2.0
* Author: wallee AG
* Author URI: https://www.wallee.com
* Requires at least: 4.7
* Tested up to: 6.3
* WC requires at least: 3.0.0
* WC tested up to: 7.8.2
*
* Text Domain: wallee
* Domain Path: /languages/
Expand Down Expand Up @@ -34,14 +39,14 @@ final class WooCommerce_Wallee {
const CK_INTEGRATION = 'wc_wallee_integration';
const CK_ORDER_REFERENCE = 'wc_wallee_order_reference';
const CK_ENFORCE_CONSISTENCY = 'wc_wallee_enforce_consistency';
const WC_MAXIMUM_VERSION = '8.7.0';
const WC_MAXIMUM_VERSION = '8.5.2';

/**
* WooCommerce Wallee version.
*
* @var string
*/
private $version = '3.0.1';
private $version = '3.0.0';

/**
* The single instance of the class.
Expand Down Expand Up @@ -442,14 +447,6 @@ public function loaded() {
10,
2
);


add_action( 'before_woocommerce_init', function() {
if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) {
\Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true );
}
} );

}

/**
Expand Down

0 comments on commit 4c10b24

Please sign in to comment.