mirror of
https://github.com/bitwarden/server.git
synced 2025-06-25 13:18:48 -05: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:
parent
34580f0472
commit
d33b0ce1cf
@ -426,6 +426,19 @@ public class OrganizationBillingService(
|
||||
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 =
|
||||
featureService.IsEnabled(FeatureFlagKeys.PM21092_SetNonUSBusinessUseToReverseCharge);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user