diff --git a/README.txt b/README.txt index 6723444..bd57702 100644 --- a/README.txt +++ b/README.txt @@ -3,7 +3,7 @@ Contributors: mondu-ai, arthurmmoreira, tikohov20 Tags: mondu, woocommerce, e-commerce, ecommerce, store, sales, sell, woo, woo commerce, shop, cart, shopping cart, sell online, checkout, payment, payments, bnpl, b2b Requires at least: 5.9.0 Tested up to: 6.5.3 -Stable tag: 3.0.1 +Stable tag: 3.0.2 Requires PHP: 7.4 License: GPLv3 License URI: https://www.gnu.org/licenses/gpl-3.0.html diff --git a/changelog.txt b/changelog.txt index 0b41829..4166809 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,21 @@ == Changelog == += 3.0.2 = + +* Added filters for buyer_fee_cents and whole order_data + += 3.0.1 = + +* Reworked Credit Note flow + += 3.0.0 = + +* Improve plugin code standards + += 2.2.0 = + +* Compatibility for high performance order storage and cart checkout blocks + = 2.1.7 = * Bugfixes and improvements diff --git a/mondu-buy-now-pay-later.php b/mondu-buy-now-pay-later.php index df286ee..2721b3b 100644 --- a/mondu-buy-now-pay-later.php +++ b/mondu-buy-now-pay-later.php @@ -3,7 +3,7 @@ * Plugin Name: Mondu Buy Now Pay Later * Plugin URI: https://github.com/mondu-ai/bnpl-checkout-woocommerce/releases * Description: Mondu provides B2B E-commerce and B2B marketplaces with an online payment solution to buy now and pay later. - * Version: 3.0.1 + * Version: 3.0.2 * Author: Mondu * Author URI: https://mondu.ai * @@ -27,7 +27,7 @@ die( 'Direct access not allowed' ); } -define( 'MONDU_PLUGIN_VERSION', '3.0.1' ); +define( 'MONDU_PLUGIN_VERSION', '3.0.2' ); define( 'MONDU_PLUGIN_FILE', __FILE__ ); define( 'MONDU_PLUGIN_PATH', __DIR__ ); define( 'MONDU_PLUGIN_BASENAME', plugin_basename(MONDU_PLUGIN_FILE) ); diff --git a/src/Mondu/Mondu/Support/OrderData.php b/src/Mondu/Mondu/Support/OrderData.php index bbf1760..592611a 100644 --- a/src/Mondu/Mondu/Support/OrderData.php +++ b/src/Mondu/Mondu/Support/OrderData.php @@ -141,6 +141,13 @@ public static function order_data_from_wc_order( WC_Order $order ) { $billing_zip_code = $order->get_billing_postcode(); $billing_country_code = $order->get_billing_country(); + /** + * @since 3.0.2 + * + * Can be used to include any additional costs that are not included by default. + */ + $buyer_fee_cents = apply_filters('mondu_buyer_fee_cents', 0, $order); + $order_data = [ 'payment_method' => array_flip( Plugin::PAYMENT_METHODS )[ $order->get_payment_method() ], 'currency' => get_woocommerce_currency(), @@ -148,6 +155,7 @@ public static function order_data_from_wc_order( WC_Order $order ) { 'gross_amount_cents' => round( (float) $order->get_total() * 100), 'net_price_cents' => round( (float) $order->get_subtotal() * 100), 'tax_cents' => round( (float) $order->get_total_tax() * 100), + 'buyer_fee_cents' => $buyer_fee_cents, 'buyer' => [ 'first_name' => isset($billing_first_name) && Helper::not_null_or_empty($billing_first_name) ? $billing_first_name : null, 'last_name' => isset($billing_last_name) && Helper::not_null_or_empty($billing_last_name) ? $billing_last_name : null, @@ -169,7 +177,10 @@ public static function order_data_from_wc_order( WC_Order $order ) { 'lines' => self::get_lines_from_order( $order ), ]; - return $order_data; + /** + * @since 3.0.2 + */ + return apply_filters('mondu_order_data', $order_data, $order); } /**