Skip to content

Commit

Permalink
Merge pull request #349 from reepay/pre-1.7.9.2
Browse files Browse the repository at this point in the history
v 1.7.9.2
  • Loading branch information
ponddeja authored Sep 26, 2024
2 parents 35a81ac + 2bf2b4b commit a536e58
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 13 deletions.
7 changes: 6 additions & 1 deletion Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: billwerk+, visa, mastercard, dankort, mobilepay
Requires at least: 4.0
Tested up to: 6.6.1
Requires PHP: 7.4
Stable tag: 1.7.9.1
Stable tag: 1.7.9.2
License: GPL
License URI: http://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html

Expand All @@ -18,6 +18,11 @@ 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.9.2
- [Fix] - WebHook URL for plain permalink structure
- [Fix] - Remove debug log is make notice message on cart page.
- [Fix] - Since v1.7.9.1, setting "skip order lines" caused the authorized amount to be multiplied by 100 one more time. Only when using saved card to pay.

v 1.7.9.1
- [Fix] – The payment method 'Vipps MobilePay Recurring' did not save the token.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,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.",
"type": "wordpress-plugin",
"license": "GPL",
"version": "1.7.9.1",
"version": "1.7.9.2",
"autoload": {
"psr-4": {
"Reepay\\Checkout\\": "includes/",
Expand Down
7 changes: 0 additions & 7 deletions includes/Api.php
Original file line number Diff line number Diff line change
Expand Up @@ -1096,13 +1096,6 @@ public function get_reepay_cards( string $customer_handle, $reepay_token = null

$result = $tmp;

wc_get_logger()->debug(
array(
'source' => 'billwerk-token',
'_legacy' => true,
)
);

if ( ! $reepay_token ) {
return $result['cards'];
}
Expand Down
16 changes: 13 additions & 3 deletions includes/Gateways/ReepayGateway.php
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,14 @@ public static function get_webhook_url(): string {
}
}

return $default_wc_api_url . 'WC_Gateway_Reepay/';
$structure = get_option( 'permalink_structure' );
if ( empty( $structure ) ) {
$default_wc_api_url = $default_wc_api_url . '=WC_Gateway_Reepay/';
} else {
$default_wc_api_url = $default_wc_api_url . 'WC_Gateway_Reepay/';
}

return $default_wc_api_url;
}

/**
Expand Down Expand Up @@ -1006,7 +1013,7 @@ public function process_payment( $order_id ) {
return $this->process_session_charge( $params, $order );
} else {
$order_lines = 'no' === $this->skip_order_lines ? $this->get_order_items( $order ) : null;
$amount = 'yes' === $this->skip_order_lines ? $this->get_skip_order_lines_amount( $order ) : null;
$amount = 'yes' === $this->skip_order_lines ? $this->get_skip_order_lines_amount( $order, true ) : null;

// Charge payment.
$result = reepay()->api( $this )->charge( $order, $token->get_token(), $amount, $order_lines );
Expand Down Expand Up @@ -1582,8 +1589,9 @@ public function get_order_items( WC_Order $order, bool $only_not_settled = false
* Get order amount from order item amount
*
* @param WC_Order $order order to get items.
* @param bool $skip_fn_rp_amount skip call funcion rp_prepare_amount.
*/
public function get_skip_order_lines_amount( WC_Order $order ) {
public function get_skip_order_lines_amount( WC_Order $order, $skip_fn_rp_amount = false ) {
$total_amount = 0;

if ( wcs_cart_have_subscription() ) {
Expand All @@ -1593,6 +1601,8 @@ public function get_skip_order_lines_amount( WC_Order $order ) {
$total_amount += $item['amount'];
}
}
} elseif ( true === $skip_fn_rp_amount ) {
$total_amount = $order->get_total();
} else {
$total_amount = rp_prepare_amount( $order->get_total(), $order->get_currency() );
}
Expand Down
2 changes: 1 addition & 1 deletion reepay-woocommerce-payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.9.1
* Version: 1.7.9.2
* Text Domain: reepay-checkout-gateway
* Domain Path: /languages
* WC requires at least: 3.0.0
Expand Down

0 comments on commit a536e58

Please sign in to comment.