mirror of
https://github.com/bitwarden/server.git
synced 2025-07-01 08:02:49 -05:00
add support for passing payment method type
This commit is contained in:
@ -1,11 +1,14 @@
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Collections.Generic;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class PremiumRequestModel : IValidatableObject
|
||||
{
|
||||
// TODO: Required in future
|
||||
public PaymentMethodType? PaymentMethodType { get; set; }
|
||||
public string PaymentToken { get; set; }
|
||||
[Range(0, 99)]
|
||||
public short? AdditionalStorageGb { get; set; }
|
||||
|
@ -21,6 +21,8 @@ namespace Bit.Core.Models.Api
|
||||
public PlanType PlanType { get; set; }
|
||||
[Required]
|
||||
public string Key { get; set; }
|
||||
// TODO: Required in future if not free plan
|
||||
public PaymentMethodType? PaymentMethodType { get; set; }
|
||||
public string PaymentToken { get; set; }
|
||||
[Range(0, double.MaxValue)]
|
||||
public short AdditionalSeats { get; set; }
|
||||
@ -39,6 +41,7 @@ namespace Bit.Core.Models.Api
|
||||
OwnerKey = Key,
|
||||
Name = Name,
|
||||
Plan = PlanType,
|
||||
PaymentMethodType = PaymentMethodType,
|
||||
PaymentToken = PaymentToken,
|
||||
AdditionalSeats = AdditionalSeats,
|
||||
AdditionalStorageGb = AdditionalStorageGb.GetValueOrDefault(0),
|
||||
|
@ -1,9 +1,12 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.Models.Api
|
||||
{
|
||||
public class PaymentRequestModel
|
||||
{
|
||||
// TODO: Required in future
|
||||
public PaymentMethodType? PaymentMethodType { get; set; }
|
||||
[Required]
|
||||
public string PaymentToken { get; set; }
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
using Bit.Core.Models.Table;
|
||||
using Bit.Core.Enums;
|
||||
using Bit.Core.Models.Table;
|
||||
|
||||
namespace Bit.Core.Models.Business
|
||||
{
|
||||
@ -9,10 +10,11 @@ namespace Bit.Core.Models.Business
|
||||
public string BillingEmail { get; set; }
|
||||
public User Owner { get; set; }
|
||||
public string OwnerKey { get; set; }
|
||||
public Enums.PlanType Plan { get; set; }
|
||||
public PlanType Plan { get; set; }
|
||||
public short AdditionalSeats { get; set; }
|
||||
public short AdditionalStorageGb { get; set; }
|
||||
public bool PremiumAccessAddon { get; set; }
|
||||
public PaymentMethodType? PaymentMethodType { get; set; }
|
||||
public string PaymentToken { get; set; }
|
||||
public string CollectionName { get; set; }
|
||||
}
|
||||
|
Reference in New Issue
Block a user