mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 23:52:50 -05:00
[euvr] Separate Billing Payment/History APIs (#1932)
* [euvr] Separate Billing Payment/History APIs * Formatting * Created AccountsBillingController // Deprecated GetBilling // Simplified PaymentService helpers * Formatting
This commit is contained in:
19
src/Api/Models/Response/BillingHistoryResponseModel.cs
Normal file
19
src/Api/Models/Response/BillingHistoryResponseModel.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Bit.Core.Models.Api;
|
||||
using Bit.Core.Models.Business;
|
||||
|
||||
namespace Bit.Api.Models.Response
|
||||
{
|
||||
public class BillingHistoryResponseModel : ResponseModel
|
||||
{
|
||||
public BillingHistoryResponseModel(BillingInfo billing)
|
||||
: base("billingHistory")
|
||||
{
|
||||
Transactions = billing.Transactions?.Select(t => new BillingTransaction(t));
|
||||
Invoices = billing.Invoices?.Select(i => new BillingInvoice(i));
|
||||
}
|
||||
public IEnumerable<BillingInvoice> Invoices { get; set; }
|
||||
public IEnumerable<BillingTransaction> Transactions { get; set; }
|
||||
}
|
||||
}
|
18
src/Api/Models/Response/BillingPaymentResponseModel.cs
Normal file
18
src/Api/Models/Response/BillingPaymentResponseModel.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using Bit.Core.Models.Api;
|
||||
using Bit.Core.Models.Business;
|
||||
|
||||
namespace Bit.Api.Models.Response
|
||||
{
|
||||
public class BillingPaymentResponseModel : ResponseModel
|
||||
{
|
||||
public BillingPaymentResponseModel(BillingInfo billing)
|
||||
: base("billingPayment")
|
||||
{
|
||||
Balance = billing.Balance;
|
||||
PaymentSource = billing.PaymentSource != null ? new BillingSource(billing.PaymentSource) : null;
|
||||
}
|
||||
|
||||
public decimal Balance { get; set; }
|
||||
public BillingSource PaymentSource { get; set; }
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user