mirror of
https://github.com/bitwarden/server.git
synced 2025-07-04 01:22:50 -05:00
[PM-19566] Update MSPs to "charge_automatically" with Admin-based opt-out (#5650)
* Update provider to charge automatically with Admin Portal-based opt-out * Design feedback * Run dotnet format
This commit is contained in:
@ -46,6 +46,7 @@ public static class StripeConstants
|
||||
|
||||
public static class MetadataKeys
|
||||
{
|
||||
public const string InvoiceApproved = "invoice_approved";
|
||||
public const string OrganizationId = "organizationId";
|
||||
public const string ProviderId = "providerId";
|
||||
public const string UserId = "userId";
|
||||
|
@ -27,4 +27,8 @@ public static class CustomerExtensions
|
||||
{
|
||||
return customer != null ? customer.Balance / 100M : default;
|
||||
}
|
||||
|
||||
public static bool ApprovedToPayByInvoice(this Customer customer)
|
||||
=> customer.Metadata.TryGetValue(StripeConstants.MetadataKeys.InvoiceApproved, out var value) &&
|
||||
int.TryParse(value, out var invoiceApproved) && invoiceApproved == 1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user