Skip to content

Commit bb92f43

Browse files
authored
Check billing interval and period to set in mandate options (#3690)
1 parent 9a70a5a commit bb92f43

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

changelog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
* Tweak - Improve webhook status related messages on the settings page.
2929
* Update - Prevent editing of orders awaiting payment capture.
3030
* Add - Introduce locking and unlocking in refund flow to prevent double refund due to race condition.
31+
* Fix - Check billing interval and period to set in mandate options.
3132
* Fix - Check order currency on pay for order page to display supported payment methods.
3233

3334
= 9.0.0 - 2024-12-12 =

includes/compat/trait-wc-stripe-subscriptions.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,8 @@ private function create_mandate_options_for_order( $order, $subscriptions ) {
868868
return [];
869869
}
870870

871-
if ( 1 === count( $subscriptions ) || $cart_contain_switches ) {
871+
$has_interval = $sub_billing_period && $sub_billing_interval > 0;
872+
if ( $has_interval && ( 1 === count( $subscriptions ) || $cart_contain_switches ) ) {
872873
$mandate_options['amount_type'] = 'fixed';
873874
$mandate_options['interval'] = $sub_billing_period;
874875
$mandate_options['interval_count'] = $sub_billing_interval;

readme.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ If you get stuck, you can ask for help in the [Plugin Forum](https://wordpress.o
138138
* Tweak - Improve webhook status related messages on the settings page.
139139
* Update - Prevent editing of orders awaiting payment capture.
140140
* Add - Introduce locking and unlocking in refund flow to prevent double refund due to race condition.
141+
* Fix - Check billing interval and period to set in mandate options.
141142
* Fix - Check order currency on pay for order page to display supported payment methods.
142143

143144
[See changelog for all versions](https://raw.githubusercontent.com/woocommerce/woocommerce-gateway-stripe/trunk/changelog.txt).

0 commit comments

Comments
 (0)