Skip to content

Commit

Permalink
fix: fixes #77 - refunds could not be processed properly because of a…
Browse files Browse the repository at this point in the history
… mistake when calling the `woocommerce_order_after_calculate_totals` action. We assume the object is always a subscription, when it is not
  • Loading branch information
Marcuzz committed Sep 21, 2023
1 parent c21cae1 commit 794d1d4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
3 changes: 3 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ Alternatively you could look into using WooCommerce "Early renewals": [https://d

== Changelog ==

= 1.16.5 =
* Fixed: Refunds could not be processed properly because of a mistake when calling the `woocommerce_order_after_calculate_totals` action. We assume the object is always a subscription, when it is not.

= 1.16.4 =
* Fixed: Properly stop checking for a gateway change when a gateway change succeeded.

Expand Down
8 changes: 5 additions & 3 deletions includes/wc-gateway-vipps-recurring.php
Original file line number Diff line number Diff line change
Expand Up @@ -2039,10 +2039,12 @@ public function prevent_backwards_transition_on_completed_order( $status, $order
}

public function update_agreement_price_in_app( $and_taxes, $subscription ) {
$payment_method = WC_Vipps_Recurring_Helper::get_payment_method( $subscription );
if ( ! wcs_is_subscription( $subscription ) ) {
return;
}

if ( $this->id !== $payment_method
|| ! wcs_is_subscription( $subscription ) ) {
$payment_method = WC_Vipps_Recurring_Helper::get_payment_method( $subscription );
if ( $this->id !== $payment_method ) {
return;
}

Expand Down
4 changes: 2 additions & 2 deletions woo-vipps-recurring.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Description: Offer recurring payments with Vipps for WooCommerce Subscriptions
* Author: Everyday AS
* Author URI: https://everyday.no
* Version: 1.16.4
* Version: 1.16.5
* Requires at least: 4.4
* Tested up to: 6.3
* WC tested up to: 8.0
Expand All @@ -17,7 +17,7 @@

// phpcs:disable WordPress.Files.FileName

define( 'WC_VIPPS_RECURRING_VERSION', '1.16.4' );
define( 'WC_VIPPS_RECURRING_VERSION', '1.16.5' );

add_action( 'plugins_loaded', 'woocommerce_gateway_vipps_recurring_init' );

Expand Down

0 comments on commit 794d1d4

Please sign in to comment.