diff --git a/Readme.txt b/Readme.txt index 38701c49..baa750ec 100755 --- a/Readme.txt +++ b/Readme.txt @@ -4,7 +4,7 @@ Tags: billwerk+, visa, mastercard, dankort, mobilepay Requires at least: 4.0 Tested up to: 6.5.3 Requires PHP: 7.4 -Stable tag: 1.7.6 +Stable tag: 1.7.7 License: GPL License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html @@ -18,6 +18,14 @@ The Billwerk+ Pay plugin extends WooCommerce allowing you to take payments on yo See installation guide right here: https://docu.billwerk.plus/help/en/apps/woocommerce/setup-woocommerce-plugin.html == Changelog == +v 1.7.7 - +* [Fix] - Missing payment_method_reference data in the Billwerk+ customer_payment_method_added webhook could cause PHP fatal error. +* [Fix] - WooCommerce Subscriptions had issues with change of payment method where orders got payment authorized but were not automatically captured and set to complete. +* [Fix] - Instant capture didn't work for orders with discount. +* [Fix] - Amounts in order notes were wrong for "Failed to settle" notes and some captures. +* [Improvement] - A WordPress notice appears when the module starts to use another API key. This is because the subscriptions are defined in the Billwerk+ account, and the notice is only showed if the subscription module "Optimize" is installed. +* [Compatibility] - Billwerk+ Optimize version 1.2.7 + v 1.7.6 - * [Fix] - Allow the activation of Santander and enforce a redirect for this payment. * [Compatibility] - Billwerk+ Optimize version 1.2.6 diff --git a/includes/Functions/order.php b/includes/Functions/order.php index 803771df..de7fc8b2 100644 --- a/includes/Functions/order.php +++ b/includes/Functions/order.php @@ -6,6 +6,7 @@ */ use Reepay\Checkout\Utils\TimeKeeper; +use WC_Reepay_Renewals; defined( 'ABSPATH' ) || exit(); @@ -129,32 +130,101 @@ function rp_get_not_subs_order_by_handle( string $handle ) { * Get order by reepay order session. * * @param string $session_id reepay order session. + * @param string $handle reepay order handle. * * @return false|WC_Order */ - function rp_get_order_by_session( string $session_id ) { - $order_id = wp_cache_get( $session_id, 'reepay_order_by_session' ); + function rp_get_order_by_session( string $session_id = null, string $handle = null ) { + if ( ! is_null( $session_id ) ) { + if ( rp_hpos_enabled() ) { + $orders = wc_get_orders( + array( + 'limit' => 1, + 'meta_query' => array( //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + array( + 'key' => 'reepay_session_id', + 'value' => $session_id, + ), - if ( empty( $order_id ) ) { - $orders = wc_get_orders( - array( - 'limit' => 1, - 'meta_key' => 'reepay_session_id', //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key - 'meta_value' => $session_id, //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value - 'meta_compare' => '=', - ) - ); + ), + ) + ); + } else { + $orders = wc_get_orders( + array( + 'limit' => 1, + 'meta_key' => 'reepay_session_id', //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key + 'meta_value' => $session_id, //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_value + 'meta_compare' => '=', + ) + ); + } if ( ! empty( $orders ) ) { $order_id = reset( $orders )->get_id(); - wp_cache_set( $session_id, $order_id, 'reepay_order_by_session' ); - } else { - return false; + clean_post_cache( $order_id ); + return wc_get_order( $order_id ); + } elseif ( ! is_null( $handle ) ) { + $order = rp_get_order_by_customer( $handle ); + return $order; } + + return false; + } elseif ( ! is_null( $handle ) ) { + $order = rp_get_order_by_customer( $handle ); + return $order; + } else { + return false; } + } +} + +if ( ! function_exists( 'rp_get_order_by_customer' ) ) { + /** + * Get order by reepay order customer. + * + * @param string $customer_id reepay order customer. + * + * @return false|WC_Order + */ + function rp_get_order_by_customer( string $customer_id ) { + $reepay_list_invoice = reepay()->api( 'list-invoice' )->request( 'GET', "https://api.reepay.com/v1/list/invoice?customer=$customer_id" ); - clean_post_cache( $order_id ); - return $order_id ? wc_get_order( $order_id ) : false; + if ( is_wp_error( $reepay_list_invoice ) || empty( $reepay_list_invoice['content'] ) ) { + return ''; + } + $subscription_order = null; + foreach ( $reepay_list_invoice['content'] as $content ) { + $search_string = strpos( $content['handle'], 'order-' ); + if ( false !== $search_string ) { + $handle = $content['handle']; + $orders = wc_get_orders( + array( + 'limit' => 1, + 'meta_query' => array( //phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query + array( + 'key' => '_reepay_order', + 'value' => $handle, + ), + + ), + ) + ); + + if ( ! empty( $orders ) ) { + $order_id = reset( $orders )->get_id(); + $order = wc_get_order( $order_id ); + if ( class_exists( WC_Reepay_Renewals::class ) && WC_Reepay_Renewals::is_order_contain_subscription( $order ) || order_contains_subscription( $order ) ) { + $subscription_order = $order; + } + } + } + } + if ( null !== $subscription_order ) { + return $subscription_order; + } else { + return ''; + } } } diff --git a/includes/Gateways/ReepayCheckout.php b/includes/Gateways/ReepayCheckout.php index 95afdc6d..a30027e9 100644 --- a/includes/Gateways/ReepayCheckout.php +++ b/includes/Gateways/ReepayCheckout.php @@ -167,7 +167,7 @@ public function init_form_fields() { 'private_key_test' => array( 'title' => __( 'Test Private Key', 'reepay-checkout-gateway' ), 'type' => 'text', - 'description' => __( 'Insert your private key from your Billwerk+ Pay test account', 'reepay-checkout-gateway' ), + 'description' => __( 'Insert your private key from your test account', 'reepay-checkout-gateway' ), 'default' => '', ), 'verify_key_test' => array( @@ -613,18 +613,36 @@ public function admin_options() { public function process_admin_options(): bool { parent::process_admin_options(); - $current_key = $this->private_key ?? ''; - $woocommerce_reepay_checkout_private_key = isset( $_POST['woocommerce_reepay_checkout_private_key'] ) ? wc_clean( $_POST['woocommerce_reepay_checkout_private_key'] ) : ''; - - if ( $current_key !== $woocommerce_reepay_checkout_private_key ) { - Statistics::private_key_activated(); - } + $current_key = $this->private_key ?? ''; + $current_test_mode = $this->test_mode; + $woocommerce_reepay_checkout_private_key = isset( $_POST['woocommerce_reepay_checkout_private_key'] ) ? wc_clean( $_POST['woocommerce_reepay_checkout_private_key'] ) : ''; + $woocommerce_reepay_checkout_private_key_test = isset( $_POST['woocommerce_reepay_checkout_private_key_test'] ) ? wc_clean( $_POST['woocommerce_reepay_checkout_private_key_test'] ) : ''; + $woocommerce_reepay_checkout_test_mode = isset( $_POST['woocommerce_reepay_checkout_test_mode'] ) ? 'yes' : 'no'; $this->init_settings(); $this->private_key = $this->settings['private_key'] ?? $this->private_key; $this->private_key_test = $this->settings['private_key_test'] ?? $this->private_key_test; $this->test_mode = $this->settings['test_mode'] ?? $this->test_mode; + if ( $current_key !== $woocommerce_reepay_checkout_private_key ) { + Statistics::private_key_activated(); + } + + /** + * Condition check notic message. + */ + if ( is_plugin_active( 'reepay-subscriptions-for-woocommerce/reepay-subscriptions-for-woocommerce.php' ) ) { + if ( $current_test_mode !== $woocommerce_reepay_checkout_test_mode && $woocommerce_reepay_checkout_private_key !== $woocommerce_reepay_checkout_private_key_test ) { + if ( 'yes' === $this->test_mode ) { + add_action( 'woocommerce_update_options_checkout', array( $this, 'notice_message_test_mode_enabled' ) ); + } else { + add_action( 'woocommerce_update_options_checkout', array( $this, 'notice_message_test_mode_disabled' ) ); + } + } elseif ( $current_key !== $woocommerce_reepay_checkout_private_key ) { + add_action( 'woocommerce_update_options_checkout', array( $this, 'notice_message_live_key_changed' ) ); + } + } + reepay()->reset_settings(); parent::is_webhook_configured(); @@ -774,4 +792,43 @@ public function get_localize_script_data(): array { 'error_text' => __( 'Error with payment, please try again', 'reepay-checkout-gateway' ), ); } + + /** + * Message notice live key changed + */ + public function notice_message_live_key_changed() { + // translators: notic message live key changed. + $notice_message = sprintf( __( 'The Api key identifies the Billwerk account. Only subscription plan handles that exist under the account of the API key can be used to submit subscription orders. Read more about this here.', 'reepay-checkout-gateway' ), 'https://optimize-docs.billwerk.com/reference/account' ); + ?> +
+

+
+ Read more about this here.', 'reepay-checkout-gateway' ), 'https://optimize-docs.billwerk.com/reference/account' ); + ?> +
+

+
+ Read more about this here.', 'reepay-checkout-gateway' ), 'https://optimize-docs.billwerk.com/reference/account' ); + ?> +
+

+
+ get_quantity(), 2 ); + $unit_price = round( ( $prices_incl_tax ? $price['with_tax_and_discount'] : $price['original_with_discount'] ) / $order_item->get_quantity(), 2 ); if ( $only_not_settled && ! empty( $order_item->get_meta( 'settled' ) ) ) { continue; @@ -1453,7 +1453,7 @@ public function get_order_items( WC_Order $order, bool $only_not_settled = false $tax_percent = $price['tax_percent']; - $unit_price = round( ( $prices_incl_tax ? $price['with_tax'] : $price['original'] ) / $item_shipping->get_quantity(), 2 ); + $unit_price = round( ( $prices_incl_tax ? $price['with_tax_and_discount'] : $price['original_with_discount'] ) / $item_shipping->get_quantity(), 2 ); if ( $only_not_settled && ! empty( $item_shipping->get_meta( 'settled' ) ) ) { continue; diff --git a/includes/OrderFlow/OrderCapture.php b/includes/OrderFlow/OrderCapture.php index 82e0f9ef..8f8b6949 100644 --- a/includes/OrderFlow/OrderCapture.php +++ b/includes/OrderFlow/OrderCapture.php @@ -490,8 +490,8 @@ public static function get_item_price( $order_item, WC_Order $order ): array { $tax = $price['with_tax'] - $price['original']; $price['tax_percent'] = ( $tax > 0 && $price['original'] > 0 ) ? round( 100 / ( $price['original'] / $tax ) ) : 0; - $price['original'] += $discount; - $price['with_tax'] += $discount; + $price['original_with_discount'] = $price['original'] + $discount; + $price['with_tax_and_discount'] = $price['with_tax'] + $discount; return $price; } diff --git a/includes/OrderFlow/Webhook.php b/includes/OrderFlow/Webhook.php index 466eea8d..43be2a0d 100644 --- a/includes/OrderFlow/Webhook.php +++ b/includes/OrderFlow/Webhook.php @@ -446,7 +446,7 @@ public function process( array $data ) { break; case 'customer_payment_method_added': if ( ! empty( $data['payment_method_reference'] ) ) { - $order = rp_get_order_by_session( $data['payment_method_reference'] ); + $order = rp_get_order_by_session( $data['payment_method_reference'], $data['customer'] ); if ( $order && order_contains_subscription( $order ) ) { WC_Subscriptions_Manager::activate_subscriptions_for_order( $order ); diff --git a/languages/reepay-checkout-gateway-en_US.mo b/languages/reepay-checkout-gateway-en_US.mo index 2518c1cf..5c1416a3 100644 Binary files a/languages/reepay-checkout-gateway-en_US.mo and b/languages/reepay-checkout-gateway-en_US.mo differ diff --git a/languages/reepay-checkout-gateway-en_US.po b/languages/reepay-checkout-gateway-en_US.po old mode 100644 new mode 100755 index 63886a68..7c1026f7 --- a/languages/reepay-checkout-gateway-en_US.po +++ b/languages/reepay-checkout-gateway-en_US.po @@ -1,311 +1,933 @@ msgid "" msgstr "" "Project-Id-Version: Woocommerce Gateway ReePay Checkout\n" -"POT-Creation-Date: 2019-01-13 14:06+0600\n" -"PO-Revision-Date: 2019-01-13 14:06+0600\n" +"POT-Creation-Date: 2024-07-08 09:45+0700\n" +"PO-Revision-Date: 2024-07-08 09:46+0700\n" "Last-Translator: aait \n" "Language-Team: \n" "Language: en_US\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 2.0.6\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.4.4\n" "X-Poedit-KeywordsList: __;_e;_e(sprintf;__(sprintf\n" "X-Poedit-Basepath: .\n" "X-Poedit-SourceCharset: UTF-8\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" "X-Poedit-SearchPath-0: ..\n" -#: ../includes/abstracts/abstract-wc-payment-gateway-reepay.php:198 -msgid "Discount" +#: ../assets/dist/js/woo-blocks.js:29 +#: ../includes/Gateways/ReepayCheckout.php:49 +#: ../includes/Gateways/ReepayCheckout.php:116 +#: ../includes/Gateways/ReepayCheckout.php:122 +#: ../templates/admin/admin-options.php:29 +msgid "Billwerk+ Pay" +msgstr "" + +#: ../assets/dist/js/woo-blocks.js:99 +msgid "Use a new payment method" +msgstr "" + +#: ../assets/dist/js/woo-blocks.js:153 +msgid "Save to account" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:18 +msgid "Error api response" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Update" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Delete" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Add new meta field" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Key" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Value" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Add meta field" +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Loading..." +msgstr "" + +#: ../assets/dist/vite/meta-fields/assets/meta-fields-DeJ_ZxWH.js:23 +msgid "Debug: User meta fields" +msgstr "" + +#: ../includes/Actions/Subscriptions.php:380 +#, php-format +msgid "Error: \"%1$s\". %2$s." +msgstr "" + +#: ../includes/Actions/Subscriptions.php:420 +#, php-format +msgid "Via %1$s card ending in %2$s/%3$s" +msgstr "" + +#: ../includes/Admin/Ajax.php:73 ../includes/Admin/Ajax.php:96 +#: ../includes/Admin/Ajax.php:132 +msgid "Order id not specified" +msgstr "" + +#: ../includes/Admin/Ajax.php:82 +msgid "Capture success." +msgstr "" + +#: ../includes/Admin/Ajax.php:104 +msgid "Order already cancelled." +msgstr "" + +#: ../includes/Admin/Ajax.php:119 +msgid "Cancel success." +msgstr "" + +#: ../includes/Admin/Ajax.php:144 +msgid "Payment method not found at the order" +msgstr "" + +#: ../includes/Admin/Ajax.php:149 +msgid "Refund success." +msgstr "" + +#: ../includes/Admin/Ajax.php:171 +msgid "Capture partly success." +msgstr "" + +#: ../includes/Admin/Ajax.php:206 +msgid "Refund partly success." +msgstr "" + +#: ../includes/Admin/Ajax.php:219 +msgid "Order id or settle order not specified" +msgstr "" + +#: ../includes/Admin/Main.php:75 +msgid "Please wait..." +msgstr "" + +#: ../includes/Admin/MetaBoxes/Order.php:63 +msgid "Debug: Order meta fields" +msgstr "" + +#: ../includes/Admin/MetaBoxes/Order.php:96 +msgid "Customer" +msgstr "" + +#: ../includes/Admin/MetaBoxes/Order.php:110 +msgid "Invoice" +msgstr "" + +#: ../includes/Admin/MetaBoxes/Order.php:125 +msgid "Subscription" +msgstr "" + +#: ../includes/Admin/PluginsPage.php:36 +msgid "Settings" +msgstr "" + +#: ../includes/Api.php:248 +#, php-format +msgid "" +"Billwerk+ Pay: API key not specified. Specify it in gateway settings" +msgstr "" + +#: ../includes/Api.php:294 ../includes/Api.php:340 +msgid "Unknown error." +msgstr "" + +#: ../includes/Api.php:297 +#, php-format +msgid "Invalid HTTP Code: %s" +msgstr "" + +#: ../includes/Api.php:307 +msgid "Billwerk+ Pay: Request rate limit exceeded" +msgstr "" + +#: ../includes/Api.php:322 +#, php-format +msgid "API Error: %1$s - %2$s." +msgstr "" + +#: ../includes/Api.php:329 +#, php-format +msgid "API Error (request): %1$s. Error Code: %2$s" +msgstr "" + +#: ../includes/Api.php:335 +#, php-format +msgid "API Error (request): %1$s. HTTP Code: %2$s" +msgstr "" + +#: ../includes/Api.php:680 +#, php-format +msgid "Failed to charge \"%1$s\". Error: %2$s. Token ID: %3$s" +msgstr "" + +#: ../includes/Api.php:780 +#, php-format +msgid "Failed to settle %1$s. Error: %2$s." +msgstr "" + +#: ../includes/Api.php:820 ../includes/Api.php:990 +#, php-format +msgid "Payment has been settled. Amount: %1$s. Transaction: %2$s" +msgstr "" + +#: ../includes/Api.php:851 +#, php-format +msgid "Failed to cancel the payment. Error: %s." +msgstr "" + +#: ../includes/Api.php:867 ../includes/Api.php:1004 ../includes/Api.php:1009 +msgid "Payment has been cancelled." +msgstr "" + +#: ../includes/Api.php:903 +#, php-format +msgid "Failed to refund \"%1$s\". Error: %2$s." +msgstr "" + +#: ../includes/Api.php:927 +#, php-format +msgid "Refunded: %1$s. Credit Note Id #%2$s. Reason: %3$s" +msgstr "" + +#: ../includes/Api.php:959 +#, php-format +msgid "Transaction is pending. Amount: %1$s. Transaction: %2$s" +msgstr "" + +#: ../includes/Api.php:972 ../includes/OrderFlow/Webhook.php:159 +#, php-format +msgid "Payment has been authorized. Amount: %1$s. Transaction: %2$s" +msgstr "" + +#: ../includes/Gateways/Anyday.php:42 +msgid "Billwerk+ Pay - Anyday" +msgstr "" + +#: ../includes/Gateways/ApplePay.php:46 +msgid "Billwerk+ Pay - Apple Pay" +msgstr "" + +#: ../includes/Gateways/Googlepay.php:44 +msgid "Billwerk+ Pay - Google Pay" +msgstr "" + +#: ../includes/Gateways/KlarnaDBT.php:42 +msgid "Billwerk+ Pay - Klarna Direct Bank Transfer" +msgstr "" + +#: ../includes/Gateways/KlarnaDD.php:42 +msgid "Billwerk+ Pay - Klarna Direct Debit" +msgstr "" + +#: ../includes/Gateways/KlarnaPayLater.php:42 +msgid "Billwerk+ Pay - Klarna Pay Later" +msgstr "" + +#: ../includes/Gateways/KlarnaPayNow.php:42 +msgid "Billwerk+ Pay - Klarna Pay Now" +msgstr "" + +#: ../includes/Gateways/KlarnaSliceIt.php:42 +msgid "Billwerk+ Pay - Klarna Slice It" +msgstr "" + +#: ../includes/Gateways/Mobilepay.php:42 +msgid "Billwerk+ Pay - Mobilepay" +msgstr "" + +#: ../includes/Gateways/MobilepaySubscriptions.php:44 +msgid "Billwerk+ Pay - Mobilepay Subscriptions" +msgstr "" + +#: ../includes/Gateways/OfflineCash.php:42 +msgid "Billwerk+ Pay - Cash" +msgstr "" + +#: ../includes/Gateways/OfflineTransfer.php:42 +msgid "Billwerk+ Pay - Bank Transfer" +msgstr "" + +#: ../includes/Gateways/Other.php:42 +msgid "Billwerk+ Pay - Other" +msgstr "" + +#: ../includes/Gateways/PESantander.php:44 +msgid "Billwerk+ Pay - Santander" +msgstr "" + +#: ../includes/Gateways/PPBancontact.php:42 +msgid "Billwerk+ Pay - Bancontact" +msgstr "" + +#: ../includes/Gateways/PPBlik.php:42 +msgid "Billwerk+ Pay - BLIK" +msgstr "" + +#: ../includes/Gateways/PPEps.php:42 +msgid "Billwerk+ Pay - EPS" +msgstr "" + +#: ../includes/Gateways/PPEstonianBanks.php:42 +msgid "Billwerk+ Pay - Estonian Banks" +msgstr "" + +#: ../includes/Gateways/PPGiroPay.php:42 +msgid "Billwerk+ Pay - GiroPay" +msgstr "" + +#: ../includes/Gateways/PPIdeal.php:44 +msgid "Billwerk+ Pay - iDEAL" +msgstr "" + +#: ../includes/Gateways/PPLatvianBanks.php:42 +msgid "Billwerk+ Pay - Latvian Banks" +msgstr "" + +#: ../includes/Gateways/PPLithuanianBanks.php:42 +msgid "Billwerk+ Pay - Lithuanian Banks" +msgstr "" + +#: ../includes/Gateways/PPMBWay.php:42 +msgid "Billwerk+ Pay - MB Way" +msgstr "" + +#: ../includes/Gateways/PPMultibanco.php:42 +msgid "Billwerk+ Pay - Multibanco" +msgstr "" + +#: ../includes/Gateways/PPMybank.php:42 +msgid "Billwerk+ Pay - MBank" +msgstr "" + +#: ../includes/Gateways/PPPaySafeCard.php:42 +msgid "Billwerk+ Pay - Paysafecard" +msgstr "" + +#: ../includes/Gateways/PPPaycoinq.php:42 +msgid "Billwerk+ Pay - Paycoinq" +msgstr "" + +#: ../includes/Gateways/PPPaysera.php:42 +msgid "Billwerk+ Pay - Paysera" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:67 -#: ../includes/class-wc-gateway-reepay-checkout.php:178 -#: ../includes/class-wc-gateway-reepay-checkout.php:184 -#: ../templates/admin/admin-options.php:11 -msgid "Reepay Checkout" +#: ../includes/Gateways/PPPostFinance.php:42 +msgid "Billwerk+ Pay - PostFinance" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:169 +#: ../includes/Gateways/PPPr24.php:42 +msgid "Billwerk+ Pay - Przelewy24" +msgstr "" + +#: ../includes/Gateways/PPSatisPay.php:42 +msgid "Billwerk+ Pay - Satisfy" +msgstr "" + +#: ../includes/Gateways/PPSepa.php:44 +msgid "Billwerk+ Pay - SEPA Direct Debit" +msgstr "" + +#: ../includes/Gateways/PPTrustly.php:42 +msgid "Billwerk+ Pay - Trustly" +msgstr "" + +#: ../includes/Gateways/PPVerkkoPankki.php:42 +msgid "Billwerk+ Pay - Finland Banks" +msgstr "" + +#: ../includes/Gateways/PPWeChatPay.php:42 +msgid "Billwerk+ Pay - WeChat Pay" +msgstr "" + +#: ../includes/Gateways/Paypal.php:42 +msgid "Billwerk+ Pay - PayPal" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:104 msgid "Enable/Disable" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:171 +#: ../includes/Gateways/ReepayCheckout.php:106 msgid "Enable plugin" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:175 +#: ../includes/Gateways/ReepayCheckout.php:113 msgid "Title" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:177 -msgid "This controls the title which the user sees during checkout." +#: ../includes/Gateways/ReepayCheckout.php:115 +msgid "This controls the title which the user sees during checkout" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:181 +#: ../includes/Gateways/ReepayCheckout.php:119 msgid "Description" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:183 -msgid "This controls the description which the user sees during checkout." +#: ../includes/Gateways/ReepayCheckout.php:121 +msgid "This controls the description which the user sees during checkout" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:128 +msgid "Live Private Key" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:130 +msgid "Insert your private key from your live account" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:140 +#: ../includes/Gateways/ReepayCheckout.php:180 +msgid "Account" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:149 +#: ../includes/Gateways/ReepayCheckout.php:189 +#: ../templates/meta-boxes/invoice.php:39 +msgid "State" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:187 -#: ../includes/class-wc-gateway-reepay-checkout.php:189 -msgid "Private key" +#: ../includes/Gateways/ReepayCheckout.php:168 +msgid "Test Private Key" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:193 -#: ../includes/class-wc-gateway-reepay-checkout.php:195 -msgid "Public key" +#: ../includes/Gateways/ReepayCheckout.php:170 +msgid "Insert your private key from your test account" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:199 +#: ../includes/Gateways/ReepayCheckout.php:209 msgid "Test Mode" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:201 +#: ../includes/Gateways/ReepayCheckout.php:211 msgid "Enable Test Mode" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:205 -#: ../includes/class-wc-gateway-reepay-checkout.php:207 -msgid "Capture automatically" +#: ../includes/Gateways/ReepayCheckout.php:218 +#: ../includes/Gateways/ReepayCheckout.php:220 +msgid "Email address for notification about failed webhooks" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:225 +msgid "Email address is invalid." msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:211 -msgid "Payment Type" +#: ../includes/Gateways/ReepayCheckout.php:233 +msgid "Payment Window Display" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:234 +msgid "" +"Choose between a redirect window or a overlay window. Note that some payment " +"methods like Apple Pay do not work for overlay window." msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:212 -msgid "Only Token support WooCommerce Subscriptions" +#: ../includes/Gateways/ReepayCheckout.php:243 +#: ../includes/Gateways/ReepayCheckout.php:244 +msgid "Payment Methods" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:222 -msgid "Language" +#: ../includes/Gateways/ReepayCheckout.php:277 +msgid "Instant Settle" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:225 +#: ../includes/Gateways/ReepayCheckout.php:278 +msgid "Instant Settle will charge your customers right away" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:282 +msgid "Instant Settle online / virtualproducts" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:283 +msgid "Instant Settle physical products" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:284 +msgid "Instant Settle recurring (subscription) products" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:285 +msgid "Instant Settle fees" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:291 +msgid "Language In Payment Window" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:294 +msgid "Detect Automatically" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:295 msgid "English" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:226 +#: ../includes/Gateways/ReepayCheckout.php:296 msgid "Danish" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:227 +#: ../includes/Gateways/ReepayCheckout.php:297 msgid "Swedish" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:228 +#: ../includes/Gateways/ReepayCheckout.php:298 msgid "Norwegian" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:229 +#: ../includes/Gateways/ReepayCheckout.php:299 msgid "German" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:230 +#: ../includes/Gateways/ReepayCheckout.php:300 msgid "Spanish" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:231 +#: ../includes/Gateways/ReepayCheckout.php:301 msgid "French" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:232 +#: ../includes/Gateways/ReepayCheckout.php:302 msgid "Italian" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:233 -msgid "Nederlands" +#: ../includes/Gateways/ReepayCheckout.php:303 +msgid "Netherlands" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:238 +#: ../includes/Gateways/ReepayCheckout.php:308 +msgid "Auto-settle" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:309 +msgid "Disable settle orders on status changing to completed" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:311 +msgid "Disable auto-settle" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:315 +msgid "Allow Credit Card saving" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:317 +msgid "Enable Save CC feature" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:324 msgid "Debug" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:240 +#: ../includes/Gateways/ReepayCheckout.php:326 msgid "Enable logging" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:244 -msgid "Payment logos" +#: ../includes/Gateways/ReepayCheckout.php:330 +msgid "Show meta fields in orders" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:332 +#: ../includes/Gateways/ReepayCheckout.php:338 +msgid "Enable display" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:245 -msgid "Payment logos on checkout" +#: ../includes/Gateways/ReepayCheckout.php:336 +msgid "Show meta fields in users" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:248 +#: ../includes/Gateways/ReepayCheckout.php:345 +msgid "Payment Logos" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:347 +msgid "" +"Choose the logos you would like to show in WooCommerce checkout. Make sure " +"that they are enabled in Billwerk+ Pay Dashboard" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:353 msgid "Dankort" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:249 +#: ../includes/Gateways/ReepayCheckout.php:354 msgid "Visa" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:250 +#: ../includes/Gateways/ReepayCheckout.php:355 msgid "MasterCard" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:251 +#: ../includes/Gateways/ReepayCheckout.php:356 msgid "Visa Electron" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:252 +#: ../includes/Gateways/ReepayCheckout.php:357 msgid "Maestro" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:253 +#: ../includes/Gateways/ReepayCheckout.php:358 +msgid "Paypal" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:359 msgid "MobilePay Online" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:254 +#: ../includes/Gateways/ReepayCheckout.php:360 +msgid "ApplePay" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:361 +msgid "Klarna" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:362 msgid "Viabill" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:255 +#: ../includes/Gateways/ReepayCheckout.php:363 +msgid "Resurs Bank" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:364 msgid "Forbrugsforeningen" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:256 +#: ../includes/Gateways/ReepayCheckout.php:365 msgid "AMEX" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:257 +#: ../includes/Gateways/ReepayCheckout.php:366 msgid "JCB" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:258 +#: ../includes/Gateways/ReepayCheckout.php:367 msgid "Diners Club" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:259 +#: ../includes/Gateways/ReepayCheckout.php:368 msgid "Unionpay" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:260 +#: ../includes/Gateways/ReepayCheckout.php:369 msgid "Discover" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:287 +#: ../includes/Gateways/ReepayCheckout.php:370 +msgid "Google pay" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:371 +msgid "Vipps" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:377 +msgid "Logo Height" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:379 +msgid "Set the Logo height in pixels" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:386 +#: ../includes/Gateways/ReepayCheckout.php:388 +msgid "Order handle failover" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:389 msgid "" -"Reepay is enabled, but a SSL certificate is not detected. Your checkout may " -"not be secure! Please ensure your server has a valid" +"In case if invoice with current handle was settled before, plugin will " +"generate unique handle" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:393 +msgid "Skip order lines" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:288 -msgid "SSL certificate" +#: ../includes/Gateways/ReepayCheckout.php:394 +msgid "Select if order lines should not be send to Billwerk+ Pay" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:331 -#: ../includes/class-wc-gateway-reepay-checkout.php:355 -msgid "Pay" +#: ../includes/Gateways/ReepayCheckout.php:403 +#: ../includes/Gateways/ReepayCheckout.php:404 +msgid "The automatic order auto-cancel" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:413 +msgid "Payment button text" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:415 +msgid "" +"Text on button which will be displayed on payment page if subscription " +"products is being purchased" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:483 -msgid "Failed to load token." +#: ../includes/Gateways/ReepayCheckout.php:518 +msgid "Save and verify" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:490 -msgid "Access denied." +#: ../includes/Gateways/ReepayCheckout.php:560 +msgid "Webhook" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:576 +#: ../includes/Gateways/ReepayCheckout.php:702 +#, php-format +msgid "Payment method changed to \"%s\"" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:731 +#, php-format +msgid "Payment has been authorized. Amount: %s." +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:745 +#, php-format +msgid "Payment has been settled. Amount: %s." +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:776 +msgid "Payment was canceled, please try again" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:777 +msgid "Error with payment, please try again" +msgstr "" + +#: ../includes/Gateways/ReepayCheckout.php:785 +#, php-format +msgid "" +"The Api key identifies the Billwerk account. Only subscription plan handles " +"that exist under the account of the API key can be used to submit " +"subscription orders. Read more about this " +"here." +msgstr "" + +#: ../includes/Gateways/ReepayGateway.php:241 +#: ../includes/Gateways/ReepayGateway.php:264 +#: ../includes/Gateways/ReepayGateway.php:281 +msgid "Add card" +msgstr "" + +#: ../includes/Gateways/ReepayGateway.php:333 msgid "There was a problem adding the card." msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:593 -#: ../includes/class-wc-gateway-reepay-checkout.php:693 -#: ../includes/class-wc-gateway-reepay-checkout.php:1173 -msgid "Payment authorized." +#: ../includes/Gateways/ReepayGateway.php:340 +msgid "Payment method successfully added." +msgstr "" + +#: ../includes/Gateways/ReepayGateway.php:514 +msgid "Billwerk+ Pay: WebHook has been successfully created/updated" +msgstr "" + +#: ../includes/Gateways/ReepayGateway.php:523 +msgid "Unable to retrieve the webhook settings. Wrong api credentials?" +msgstr "" + +#: ../includes/Gateways/Resurs.php:42 +msgid "Billwerk+ Pay - Resurs Bank" +msgstr "" + +#: ../includes/Gateways/Swish.php:42 +msgid "Billwerk+ Pay - Swish" +msgstr "" + +#: ../includes/Gateways/Viabill.php:42 +msgid "Billwerk+ Pay - ViaBill" +msgstr "" + +#: ../includes/Gateways/Vipps.php:44 +msgid "Billwerk+ Pay - Vipps" +msgstr "" + +#: ../includes/Gateways/VippsRecurring.php:46 +msgid "Billwerk+ Pay - Vipps Recurring" +msgstr "" + +#: ../includes/Integrations/PWGiftCardsIntegration.php:63 +#, php-format +msgid "PW gift card (%s)" +msgstr "" + +#: ../includes/OrderFlow/OrderCapture.php:110 +#: ../includes/OrderFlow/OrderCapture.php:133 +msgid "Capture" +msgstr "" + +#: ../includes/OrderFlow/OrderCapture.php:304 +#: ../includes/OrderFlow/OrderCapture.php:374 +msgid "Failed to settle item" +msgstr "" + +#: ../includes/OrderFlow/OrderStatuses.php:109 +msgid "Sync statuses" +msgstr "" + +#: ../includes/OrderFlow/OrderStatuses.php:111 +msgid "Enable sync" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:598 -#: ../includes/class-wc-gateway-reepay-checkout.php:701 -#: ../includes/class-wc-gateway-reepay-checkout.php:1178 -msgid "Transaction settled." +#: ../includes/OrderFlow/OrderStatuses.php:112 +msgid "" +"2-way synchronization of order statuses in Woocommerce with invoice statuses " +"in Billwerk+ Pay" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:603 -msgid "Payment failed" +#: ../includes/OrderFlow/OrderStatuses.php:127 +msgid "Status: Billwerk+ Pay Created" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:846 -msgid "Transaction captured." +#: ../includes/OrderFlow/OrderStatuses.php:142 +msgid "Status: Billwerk+ Pay Authorized" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:882 -#: ../includes/class-wc-gateway-reepay-checkout.php:884 -msgid "Transaction cancelled." +#: ../includes/OrderFlow/OrderStatuses.php:157 +msgid "Status: Billwerk+ Pay Settled" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:924 +#: ../includes/OrderFlow/OrderStatuses.php:412 +#: ../includes/OrderFlow/OrderStatuses.php:447 #, php-format -msgid "Refunded: %s. Credit Note Id #%s. Reason: %s" +msgid "Order status rollback. %s" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:1186 +#: ../includes/OrderFlow/OrderStatuses.php:437 #, php-format -msgid "Failed to charge \"%s\". %s." +msgid "" +"Error with order #%2$u. View order notes for more info" msgstr "" -#: ../includes/class-wc-gateway-reepay-checkout.php:1210 +#: ../includes/OrderFlow/ThankyouPage.php:111 +msgid "Please wait. We're checking the payment status." +msgstr "" + +#: ../includes/OrderFlow/Webhook.php:310 +msgid "Cancelled by WebHook." +msgstr "" + +#: ../includes/OrderFlow/Webhook.php:361 #, php-format -msgid "Via %s card ending in %s/%s" +msgid "Credit Note Id #%s." msgstr "" -#: ../includes/class-wc-payment-token-reepay.php:154 +#: ../includes/OrderFlow/Webhook.php:381 +#, php-format +msgid "Refunded: %1$s. Reason: %2$s" +msgstr "" + +#: ../includes/Plugin/WoocommerceExists.php:56 +msgid "" +"WooCommerce plugin is inactive or missing. Please install and active it." +msgstr "" + +#: ../includes/Plugin/WoocommerceExists.php:60 +msgid "WooCommerce Billwerk+ Pay Gateway isn't active now." +msgstr "" + +#: ../includes/Tokens/ReepayTokens.php:102 +#: ../includes/Tokens/ReepayTokens.php:163 +msgid "Card not found" +msgstr "" + +#: ../includes/Tokens/TokenReepay.php:220 +msgid "Token not found" +msgstr "" + +#: ../includes/Tokens/TokenReepay.php:232 #, php-format msgid "%1$s ending in %2$s" msgstr "" -#: ../templates/admin/admin-options.php:15 +#: ../includes/Tokens/TokenReepayMS.php:44 +#, php-format +msgid "Billwerk+ Pay - Mobilepay Subscriptions [%s]" +msgstr "" + +#: ../templates/admin/admin-options.php:19 +#, php-format +msgid "" +"You just enabled test mode, meaning your test API key will now be used. " +"Please note that all subscription products previously linked to plans on " +"your live account are no longer linked. If you try to purchase a " +"subscription product now, an error will occur. Disabling test mode will " +"restore all connections. Read more about " +"this here." +msgstr "" + +#: ../templates/admin/admin-options.php:21 +#, php-format +msgid "" +"You just disabled test mode, meaning your live API key will now be used. " +"Please note that all subscription products previously linked to plans on " +"your live account are now restored. If you haven't linked your subscription " +"products with your test account, they will remain unlinked. Read more about this here." +msgstr "" + +#: ../templates/admin/admin-options.php:35 #, php-format msgid "" -"Please setup WebHook in Reepay Dashboard." +"Please setup WebHook in Billwerk+ Pay " +"Dashboard." msgstr "" -#: ../templates/admin/admin-options.php:22 +#: ../templates/admin/admin-options.php:43 #, php-format -msgid "WebHook URL: %s" +msgid "WebHook URL: %2$s" msgstr "" -#: ../templates/admin/payment-actions.php:16 +#: ../templates/admin/payment-actions.php:22 msgid "Capture Payment" msgstr "" -#: ../templates/admin/payment-actions.php:24 +#: ../templates/admin/payment-actions.php:30 msgid "Cancel Payment" msgstr "" -#: ../templates/checkout/payment-fields.php:21 -#, php-format -msgid "Pay with %s on Reepay" +#: ../templates/meta-boxes/customer.php:14 ../templates/meta-boxes/plan.php:14 +msgid "Handle" msgstr "" -#: ../reepay-checkout-gateway.php:68 -msgid "Settings" +#: ../templates/meta-boxes/customer.php:20 +msgid "Email" msgstr "" -#: ../reepay-checkout-gateway.php:184 -#: ../reepay-checkout-gateway.php:199 -#, php-format -msgid "Order status rollback. %s" +#: ../templates/meta-boxes/customer.php:27 +msgid "See customer" msgstr "" -#: ../reepay-checkout-gateway.php:219 -msgid "Reepay Payments Actions" +#: ../templates/meta-boxes/invoice.php:32 +msgid "Invoice handle" msgstr "" -#: ../reepay-checkout-gateway.php:271 -msgid "Please wait..." +#: ../templates/meta-boxes/invoice.php:118 +msgid "See invoice" msgstr "" -#: ../reepay-checkout-gateway.php:299 -#: ../reepay-checkout-gateway.php:325 -msgid "Capture success." +#: ../templates/meta-boxes/plan.php:20 +msgid "Plan" +msgstr "" + +#: ../templates/meta-boxes/plan.php:27 +msgid "See subscription" msgstr "" diff --git a/reepay-woocommerce-payment.php b/reepay-woocommerce-payment.php index 56628c7f..631a6f0a 100755 --- a/reepay-woocommerce-payment.php +++ b/reepay-woocommerce-payment.php @@ -4,7 +4,7 @@ * Description: Get a plug-n-play payment solution for WooCommerce, that is easy to use, highly secure and is built to maximize the potential of your e-commerce. * Author: Billwerk+ * Author URI: http://billwerk.plus - * Version: 1.7.6 + * Version: 1.7.7 * Text Domain: reepay-checkout-gateway * Domain Path: /languages * WC requires at least: 3.0.0 diff --git a/tests/unit/orderFlow/OrderCaptureTest.php b/tests/unit/orderFlow/OrderCaptureTest.php index 8dcd7636..2275f315 100644 --- a/tests/unit/orderFlow/OrderCaptureTest.php +++ b/tests/unit/orderFlow/OrderCaptureTest.php @@ -946,6 +946,8 @@ public function test_get_item_price_product() { 'original' => $price * $qty, 'with_tax' => $price * $qty, 'tax_percent' => 0, + 'original_with_discount' => $price * $qty, + 'with_tax_and_discount' => $price * $qty, ), OrderCapture::get_item_price( WC_Order_Factory::get_order_item( $order_item_id ), $this->order_generator->order() ) ); @@ -975,6 +977,8 @@ public function test_get_item_price_product_with_discount() { 'original' => $sale_price * $qty, 'with_tax' => $sale_price * $qty, 'tax_percent' => 0, + 'original_with_discount' => $sale_price * $qty, + 'with_tax_and_discount' => $sale_price * $qty, ), OrderCapture::get_item_price( WC_Order_Factory::get_order_item( $order_item_id ), $this->order_generator->order() ) ); @@ -1009,6 +1013,8 @@ public function test_get_item_price_product_with_taxes() { 'original' => $sale_price * $qty, 'with_tax' => round(( $sale_price * $qty ) * ( 1 + $tax_rate / 100 ), 2), 'tax_percent' => round($tax_rate), + 'original_with_discount' => $sale_price * $qty, + 'with_tax_and_discount' => round(( $sale_price * $qty ) * ( 1 + $tax_rate / 100 ), 2), ), OrderCapture::get_item_price( WC_Order_Factory::get_order_item( $order_item_id ), $this->order_generator->order() ) ); @@ -1031,6 +1037,8 @@ public function test_get_item_price_shipping() { 'original' => $price, 'with_tax' => $price, 'tax_percent' => 0, + 'original_with_discount' => $price, + 'with_tax_and_discount' => $price, ), OrderCapture::get_item_price( WC_Order_Factory::get_order_item( $order_item_id ), $this->order_generator->order() ) ); @@ -1053,6 +1061,8 @@ public function test_get_item_price_fee() { 'original' => $price, 'with_tax' => $price, 'tax_percent' => 0, + 'original_with_discount' => $price, + 'with_tax_and_discount' => $price, ), OrderCapture::get_item_price( WC_Order_Factory::get_order_item( $order_item_id ), $this->order_generator->order() ) );