C# Class SaasEcom.Core.Infrastructure.PaymentProcessor.Stripe.SubscriptionProvider

Implementation for subscription management with Stripe
Inheritance: ISubscriptionProvider
Afficher le fichier Open project: pedropaf/saas-ecom

Méthodes publiques

Méthode Description
EndSubscription ( string userStripeId, string subStripeId, bool cancelAtPeriodEnd = false ) : System.DateTime

Ends the subscription.

SubscribeUser ( SaasEcom.Core.Models.SaasEcomUser user, string planId, System.DateTime trialEnds, decimal taxPercent ) : string

Subscribes the user.

SubscribeUser ( SaasEcom.Core.Models.SaasEcomUser user, string planId, int trialInDays, decimal taxPercent ) : string

Subscribes the user.

SubscribeUserNaturalMonth ( SaasEcom.Core.Models.SaasEcomUser user, string planId, System.DateTime billingAnchorCycle, decimal taxPercent ) : object

Subscribes the user natural month.

SubscriptionProvider ( string apiKey ) : System

Initializes a new instance of the SubscriptionProvider class.

UpdateSubscription ( string customerId, string subStripeId, string newPlanId, bool proRate ) : bool

Updates the subscription. (Change subscription plan)

UpdateSubscriptionTax ( string customerId, string subStripeId, decimal taxPercent ) : bool

Updates the subscription tax.

UserSubscriptionsAsync ( string userId ) : Task>

Gets the User's subscriptions asynchronous.

Method Details

EndSubscription() public méthode

Ends the subscription.
public EndSubscription ( string userStripeId, string subStripeId, bool cancelAtPeriodEnd = false ) : System.DateTime
userStripeId string The user stripe identifier.
subStripeId string The sub stripe identifier.
cancelAtPeriodEnd bool if set to true [cancel at period end].
Résultat System.DateTime

SubscribeUser() public méthode

Subscribes the user.
public SubscribeUser ( SaasEcom.Core.Models.SaasEcomUser user, string planId, System.DateTime trialEnds, decimal taxPercent ) : string
user SaasEcom.Core.Models.SaasEcomUser The user.
planId string The plan identifier.
trialEnds System.DateTime The trial ends.
taxPercent decimal The tax percent.
Résultat string

SubscribeUser() public méthode

Subscribes the user.
public SubscribeUser ( SaasEcom.Core.Models.SaasEcomUser user, string planId, int trialInDays, decimal taxPercent ) : string
user SaasEcom.Core.Models.SaasEcomUser The user.
planId string The plan identifier.
trialInDays int The trial in days.
taxPercent decimal The tax percent.
Résultat string

SubscribeUserNaturalMonth() public méthode

Subscribes the user natural month.
public SubscribeUserNaturalMonth ( SaasEcom.Core.Models.SaasEcomUser user, string planId, System.DateTime billingAnchorCycle, decimal taxPercent ) : object
user SaasEcom.Core.Models.SaasEcomUser The user.
planId string The plan identifier.
billingAnchorCycle System.DateTime The billing anchor cycle.
taxPercent decimal The tax percent.
Résultat object

SubscriptionProvider() public méthode

Initializes a new instance of the SubscriptionProvider class.
public SubscriptionProvider ( string apiKey ) : System
apiKey string The API key.
Résultat System

UpdateSubscription() public méthode

Updates the subscription. (Change subscription plan)
public UpdateSubscription ( string customerId, string subStripeId, string newPlanId, bool proRate ) : bool
customerId string The customer identifier.
subStripeId string The sub stripe identifier.
newPlanId string The new plan identifier.
proRate bool if set to true [pro rate].
Résultat bool

UpdateSubscriptionTax() public méthode

Updates the subscription tax.
public UpdateSubscriptionTax ( string customerId, string subStripeId, decimal taxPercent ) : bool
customerId string The customer identifier.
subStripeId string The sub stripe identifier.
taxPercent decimal The tax percent.
Résultat bool

UserSubscriptionsAsync() public méthode

Gets the User's subscriptions asynchronous.
public UserSubscriptionsAsync ( string userId ) : Task>
userId string The user identifier.
Résultat Task>