mirror of
https://github.com/bitwarden/server
synced 2025-12-11 13:53:40 +00:00
[PM 18208]Cancel self-serve trials with no payment method (#5916)
* cancel self-serve trials with no payment method * Remove unnecessary code block * Update the invoice create for missing paymentMethod * Remove the create_invoice implementation * Remove empty spaces
This commit is contained in:
@@ -426,6 +426,19 @@ public class OrganizationBillingService(
|
|||||||
TrialPeriodDays = subscriptionSetup.SkipTrial ? 0 : plan.TrialPeriodDays
|
TrialPeriodDays = subscriptionSetup.SkipTrial ? 0 : plan.TrialPeriodDays
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Only set trial_settings.end_behavior.missing_payment_method to "cancel" if there is no payment method
|
||||||
|
if (string.IsNullOrEmpty(customer.InvoiceSettings?.DefaultPaymentMethodId) &&
|
||||||
|
!customer.Metadata.ContainsKey(BraintreeCustomerIdKey))
|
||||||
|
{
|
||||||
|
subscriptionCreateOptions.TrialSettings = new SubscriptionTrialSettingsOptions
|
||||||
|
{
|
||||||
|
EndBehavior = new SubscriptionTrialSettingsEndBehaviorOptions
|
||||||
|
{
|
||||||
|
MissingPaymentMethod = "cancel"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
var setNonUSBusinessUseToReverseCharge =
|
var setNonUSBusinessUseToReverseCharge =
|
||||||
featureService.IsEnabled(FeatureFlagKeys.PM21092_SetNonUSBusinessUseToReverseCharge);
|
featureService.IsEnabled(FeatureFlagKeys.PM21092_SetNonUSBusinessUseToReverseCharge);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user