2017-07-28 06:17:31 +02:00
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Bit.Core.Models.Table;
|
2017-07-28 18:09:12 +02:00
|
|
|
|
using Bit.Core.Models.Business;
|
2019-01-29 19:12:11 +01:00
|
|
|
|
using Bit.Core.Enums;
|
2017-07-28 06:17:31 +02:00
|
|
|
|
|
|
|
|
|
namespace Bit.Core.Services
|
|
|
|
|
{
|
|
|
|
|
public interface IPaymentService
|
|
|
|
|
{
|
2017-07-28 18:09:12 +02:00
|
|
|
|
Task CancelAndRecoverChargesAsync(ISubscriber subscriber);
|
2019-02-09 05:53:09 +01:00
|
|
|
|
Task PurchaseOrganizationAsync(Organization org, PaymentMethodType paymentMethodType, string paymentToken,
|
|
|
|
|
Models.StaticStore.Plan plan, short additionalStorageGb, short additionalSeats, bool premiumAccessAddon);
|
2019-03-22 02:36:03 +01:00
|
|
|
|
Task UpgradeFreeOrganizationAsync(Organization org, Models.StaticStore.Plan plan,
|
|
|
|
|
short additionalStorageGb, short additionalSeats, bool premiumAccessAddon);
|
2019-01-31 18:11:30 +01:00
|
|
|
|
Task PurchasePremiumAsync(User user, PaymentMethodType paymentMethodType, string paymentToken,
|
2019-01-29 19:12:11 +01:00
|
|
|
|
short additionalStorageGb);
|
2017-07-28 18:09:12 +02:00
|
|
|
|
Task AdjustStorageAsync(IStorableSubscriber storableSubscriber, int additionalStorage, string storagePlanId);
|
|
|
|
|
Task CancelSubscriptionAsync(ISubscriber subscriber, bool endOfPeriod = false);
|
|
|
|
|
Task ReinstateSubscriptionAsync(ISubscriber subscriber);
|
2019-01-31 18:11:30 +01:00
|
|
|
|
Task<bool> UpdatePaymentMethodAsync(ISubscriber subscriber, PaymentMethodType paymentMethodType,
|
|
|
|
|
string paymentToken);
|
2019-02-20 22:03:38 +01:00
|
|
|
|
Task<bool> CreditAccountAsync(ISubscriber subscriber, decimal creditAmount);
|
2017-07-28 18:09:12 +02:00
|
|
|
|
Task<BillingInfo> GetBillingAsync(ISubscriber subscriber);
|
2019-02-18 21:40:47 +01:00
|
|
|
|
Task<SubscriptionInfo> GetSubscriptionAsync(ISubscriber subscriber);
|
2017-07-28 06:17:31 +02:00
|
|
|
|
}
|
|
|
|
|
}
|