mirror of
https://github.com/bitwarden/server.git
synced 2025-04-05 05:00:19 -05:00
Merge branch 'main' into PM-17732
This commit is contained in:
commit
0ec948e8f0
@ -3,7 +3,7 @@
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net8.0</TargetFramework>
|
||||
|
||||
<Version>2025.2.1</Version>
|
||||
<Version>2025.2.2</Version>
|
||||
|
||||
<RootNamespace>Bit.$(MSBuildProjectName)</RootNamespace>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
|
@ -9,8 +9,7 @@
|
||||
|
||||
var canViewUserInformation = AccessControlService.UserHasPermission(Permission.User_UserInformation_View);
|
||||
var canViewNewDeviceException = AccessControlService.UserHasPermission(Permission.User_NewDeviceException_Edit) &&
|
||||
GlobalSettings.EnableNewDeviceVerification &&
|
||||
FeatureService.IsEnabled(Bit.Core.FeatureFlagKeys.NewDeviceVerification);
|
||||
GlobalSettings.EnableNewDeviceVerification;
|
||||
var canViewBillingInformation = AccessControlService.UserHasPermission(Permission.User_BillingInformation_View);
|
||||
var canViewGeneral = AccessControlService.UserHasPermission(Permission.User_GeneralDetails_View);
|
||||
var canViewPremium = AccessControlService.UserHasPermission(Permission.User_Premium_View);
|
||||
|
7
src/Billing/Constants/BitPayInvoiceStatus.cs
Normal file
7
src/Billing/Constants/BitPayInvoiceStatus.cs
Normal file
@ -0,0 +1,7 @@
|
||||
namespace Bit.Billing.Constants;
|
||||
|
||||
public static class BitPayInvoiceStatus
|
||||
{
|
||||
public const string Confirmed = "confirmed";
|
||||
public const string Complete = "complete";
|
||||
}
|
6
src/Billing/Constants/BitPayNotificationCode.cs
Normal file
6
src/Billing/Constants/BitPayNotificationCode.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Bit.Billing.Constants;
|
||||
|
||||
public static class BitPayNotificationCode
|
||||
{
|
||||
public const string InvoiceConfirmed = "invoice_confirmed";
|
||||
}
|
@ -1,4 +1,5 @@
|
||||
using System.Globalization;
|
||||
using Bit.Billing.Constants;
|
||||
using Bit.Billing.Models;
|
||||
using Bit.Core.AdminConsole.Repositories;
|
||||
using Bit.Core.Billing.Services;
|
||||
@ -65,7 +66,7 @@ public class BitPayController : Controller
|
||||
return new BadRequestResult();
|
||||
}
|
||||
|
||||
if (model.Event.Name != "invoice_confirmed")
|
||||
if (model.Event.Name != BitPayNotificationCode.InvoiceConfirmed)
|
||||
{
|
||||
// Only processing confirmed invoice events for now.
|
||||
return new OkResult();
|
||||
@ -75,20 +76,20 @@ public class BitPayController : Controller
|
||||
if (invoice == null)
|
||||
{
|
||||
// Request forged...?
|
||||
_logger.LogWarning("Invoice not found. #" + model.Data.Id);
|
||||
_logger.LogWarning("Invoice not found. #{InvoiceId}", model.Data.Id);
|
||||
return new BadRequestResult();
|
||||
}
|
||||
|
||||
if (invoice.Status != "confirmed" && invoice.Status != "completed")
|
||||
if (invoice.Status != BitPayInvoiceStatus.Confirmed && invoice.Status != BitPayInvoiceStatus.Complete)
|
||||
{
|
||||
_logger.LogWarning("Invoice status of '" + invoice.Status + "' is not acceptable. #" + invoice.Id);
|
||||
_logger.LogWarning("Invoice status of '{InvoiceStatus}' is not acceptable. #{InvoiceId}", invoice.Status, invoice.Id);
|
||||
return new BadRequestResult();
|
||||
}
|
||||
|
||||
if (invoice.Currency != "USD")
|
||||
{
|
||||
// Only process USD payments
|
||||
_logger.LogWarning("Non USD payment received. #" + invoice.Id);
|
||||
_logger.LogWarning("Non USD payment received. #{InvoiceId}", invoice.Id);
|
||||
return new OkResult();
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,6 @@ public static class AuthenticationSchemes
|
||||
public static class FeatureFlagKeys
|
||||
{
|
||||
/* Admin Console Team */
|
||||
public const string ProviderClientVaultPrivacyBanner = "ac-2833-provider-client-vault-privacy-banner";
|
||||
public const string AccountDeprovisioning = "pm-10308-account-deprovisioning";
|
||||
public const string VerifiedSsoDomainEndpoint = "pm-12337-refactor-sso-details-endpoint";
|
||||
public const string DeviceApprovalRequestAdminNotifications = "pm-15637-device-approval-request-admin-notifications";
|
||||
|
Loading…
x
Reference in New Issue
Block a user