mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
* Add feature flag * Further establish billing command pattern and use in PreviewTaxAmountCommand * Add billing address models/commands/queries/tests * Update TypeReadingJsonConverter to account for new union types * Add payment method models/commands/queries/tests * Add credit models/commands/queries/tests * Add command/query registrations * Add new endpoints to support new command model and payment functionality * Run dotnet format * Add InjectUserAttribute for easier AccountBillilngVNextController handling * Add InjectOrganizationAttribute for easier OrganizationBillingVNextController handling * Add InjectProviderAttribute for easier ProviderBillingVNextController handling * Add XML documentation for billing command pipeline * Fix StripeConstants post-nullability * More nullability cleanup * Run dotnet format
25 lines
677 B
C#
25 lines
677 B
C#
using Bit.Core.Settings;
|
|
using BitPayLight;
|
|
using BitPayLight.Models.Invoice;
|
|
|
|
namespace Bit.Core.Billing.Payment.Clients;
|
|
|
|
public interface IBitPayClient
|
|
{
|
|
Task<Invoice> GetInvoice(string invoiceId);
|
|
Task<Invoice> CreateInvoice(Invoice invoice);
|
|
}
|
|
|
|
public class BitPayClient(
|
|
GlobalSettings globalSettings) : IBitPayClient
|
|
{
|
|
private readonly BitPay _bitPay = new(
|
|
globalSettings.BitPay.Token, globalSettings.BitPay.Production ? Env.Prod : Env.Test);
|
|
|
|
public Task<Invoice> GetInvoice(string invoiceId)
|
|
=> _bitPay.GetInvoice(invoiceId);
|
|
|
|
public Task<Invoice> CreateInvoice(Invoice invoice)
|
|
=> _bitPay.CreateInvoice(invoice);
|
|
}
|