import { BooleanResponse } from '..'; import { Coupon, CouponName, Nullable, PaymentMethodDescription, PublicUser, Subscription, SubscriptionCancelReason, SubscriptionId, SubscriptionIntent, SubscriptionPlan, SubscriptionPlanName, UserId } from '../../models'; import { AuthRequest, OptionalAuthRequest } from '../common'; /** * StripePaymentsWebhook */ export interface StripePaymentsWebhookRequest { type: string; data: any; } export interface StripePaymentsWebhookResponse { received: boolean; } export declare const StripePaymentsWebhook: import("..").ProtocolFunction; /** * SubscribeToPlan */ export interface SubscribeToPlanRequest extends AuthRequest { plan: SubscriptionPlanName; paymentMethod: string; coupon?: CouponName; } export declare type SubscribeToPlanResponse = Nullable<{ subscriptionId: SubscriptionId; clientSecret: string; paymentStatus: string; }>; /** * Subscribes a user to a paid plan. * @param userToken The token of the user subscribing to the plan. * @param paymentMethod The unique string payment method from the payment provider. * @returns An object containing a client secret and a payment ID. */ export declare const SubscribeToPlan: import("..").ProtocolFunction>; /** * UpdatePaymentMethod */ export interface UpdatePaymentMethodRequest extends AuthRequest { paymentMethod: string; } export declare type UpdatePaymentMethodResponse = BooleanResponse; export declare const UpdatePaymentMethod: import("..").ProtocolFunction; /** * GetSubscriptionIntent */ export interface GetSubscriptionIntentRequest extends AuthRequest { plan: SubscriptionPlanName; currency?: string; couponName?: CouponName; } export declare type GetSubscriptionIntentResponse = Nullable; /** * Generates a client secret to send back to set up a checkout screen. * @param userToken The token of the user subscribing to the plan. * @param plan The name of the plan to check out for. * @param currency Three-letter ISO currency code, in lowercase. Must be a supported currency by Stripe. (https://www.iso.org/iso-4217-currency-codes.html) * @param couponName The user-facing name of the coupon being used. * @returns An object containing a client secret and a payment ID. */ export declare const GetSubscriptionIntent: import("..").ProtocolFunction>; /** * GetCoupon */ export interface GetCouponRequest extends AuthRequest { couponName: CouponName; plan?: SubscriptionPlanName; } export declare type GetCouponResponse = Nullable; export declare const GetCoupon: import("..").ProtocolFunction>; /** * GetPaymentMethod */ export interface GetPaymentMethodRequest extends AuthRequest { } export declare type GetPaymentMethodResponse = Nullable; export declare const GetPaymentMethod: import("..").ProtocolFunction>; /** * UnsubscribeFromPlan */ export interface UnsubscribeFromPlanRequest extends AuthRequest { subscriptionId: SubscriptionId; cancelReason?: SubscriptionCancelReason; } export declare type UnsubscribeFromPlanResponse = BooleanResponse; export declare const UnsubscribeFromPlan: import("..").ProtocolFunction; /** * GetUserSubscriptions */ export interface GetUserSubscriptionsRequest extends AuthRequest { } export declare type GetUserSubscriptionsResponse = Subscription[]; /** * Gets a list of the user's subscriptions. * @param userToken The token of the user. * @returns A list of the user's subscriptions. */ export declare const GetUserSubscriptions: import("..").ProtocolFunction; /** * GetUserActiveSubscriptions */ export interface GetUserActiveSubscriptionsRequest extends AuthRequest { } export declare type GetUserActiveSubscriptionsResponse = Subscription[]; /** * Gets a list of the user's active subscriptions. * @param userToken The token of the user. * @returns A list of the user's active subscriptions. */ export declare const GetUserActiveSubscriptions: import("..").ProtocolFunction; /** * AddUserToPlan */ export interface AddUserToPlanRequest extends AuthRequest { subscriptionId: SubscriptionId; userToAdd: UserId; } export declare type AddUserToPlanResponse = BooleanResponse; /** * Adds a user to a plan. * @param userToken The token of the user who owns the plan. * @param subsriptionId The ID of the subscription to modify. * @param userToAdd The ID of the user to add. * @returns True on success, false otherwise. */ export declare const AddUserToPlan: import("..").ProtocolFunction; /** * RemoveUserFromPlan */ export interface RemoveUserFromPlanRequest extends AuthRequest { subscriptionId: SubscriptionId; userToRemove: UserId; } export declare type RemoveUserFromPlanResponse = BooleanResponse; /** * Removes a user from a plan. * @param userToken The token of the user who owns the plan. * @param subsriptionId The ID of the subscription to modify. * @param userToAdd The ID of the user to remove. * @returns True on success, false otherwise. */ export declare const RemoveUserFromPlan: import("..").ProtocolFunction; /** * GetUsersByPlan */ export interface GetUsersByPlanRequest extends AuthRequest { subscriptionId: SubscriptionId; } export declare type GetUsersByPlanResponse = PublicUser[]; /** * Gets a list of users associated with the plan. * @param userToken The token of the user who owns the plan. * @param subsriptionId The ID of the subscription plan. * @returns A list of users. */ export declare const GetUsersByPlan: import("..").ProtocolFunction; /** * GetAllPlans */ export interface GetAllPlansRequest extends OptionalAuthRequest { } export declare type GetAllPlansResponse = SubscriptionPlan[]; export declare const GetAllPlans: import("..").ProtocolFunction; /** * GetPlanByName */ export interface GetPlanByNameRequest extends OptionalAuthRequest { plan: SubscriptionPlanName; } export declare type GetPlanByNameResponse = Nullable; export declare const GetPlanByName: import("..").ProtocolFunction>;