Files
server/src/Core/Billing/Payment/Clients/BitPayClient.cs
Alex Morask 7f65a655d4 [PM-21881] Manage payment details outside of checkout (#6032)
* 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
2025-07-10 08:32:25 -05:00

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);
}