1
0
mirror of https://github.com/bitwarden/server.git synced 2024-12-11 15:17:44 +01:00
bitwarden-server/src/Core/Utilities/BitPayClient.cs

30 lines
883 B
C#
Raw Normal View History

2019-02-22 04:43:37 +01:00
using System;
using System.Threading.Tasks;
namespace Bit.Core.Utilities
{
public class BitPayClient
{
private readonly BitPayLight.BitPay _bpClient;
2019-02-22 04:43:37 +01:00
public BitPayClient(GlobalSettings globalSettings)
{
if (CoreHelpers.SettingHasValue(globalSettings.BitPay.Token))
2019-03-20 04:32:54 +01:00
{
_bpClient = new BitPayLight.BitPay(globalSettings.BitPay.Token,
globalSettings.BitPay.Production ? BitPayLight.Env.Prod : BitPayLight.Env.Test);
2019-03-20 04:32:54 +01:00
}
2019-02-22 04:43:37 +01:00
}
public Task<BitPayLight.Models.Invoice.Invoice> GetInvoiceAsync(string id)
2019-02-22 04:43:37 +01:00
{
return _bpClient.GetInvoice(id);
2019-02-22 04:43:37 +01:00
}
public Task<BitPayLight.Models.Invoice.Invoice> CreateInvoiceAsync(BitPayLight.Models.Invoice.Invoice invoice)
2019-02-22 04:43:37 +01:00
{
return _bpClient.CreateInvoice(invoice);
2019-02-22 04:43:37 +01:00
}
}
}