Documentation
¶
Index ¶
- Constants
- Variables
- type Checkout
- type CreditService
- type CustomerService
- type FeatureService
- type Filter
- type OrganizationService
- type PlanService
- type Repository
- type Service
- func (s *Service) Close() error
- func (s *Service) Create(ctx context.Context, ch Checkout) (Checkout, error)
- func (s *Service) GetByID(ctx context.Context, id string) (Checkout, error)
- func (s *Service) Init(ctx context.Context)
- func (s *Service) List(ctx context.Context, filter Filter) ([]Checkout, error)
- func (s *Service) SyncWithProvider(ctx context.Context, customerID string) error
- type State
- type SubscriptionService
Constants ¶
View Source
const ( SessionValidity = time.Hour * 24 SyncDelay = time.Second * 60 )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Checkout ¶
type Checkout struct {
ID string
ProviderID string // identifier set by the billing engine provider
CustomerID string
PlanID string // uuid of plan if resource type is subscription
FeatureID string
// CancelUrl is the URL to which provider sends customers when payment is canceled
CancelUrl string
// SuccessUrl is the URL to which provider sends customers when payment is complete
SuccessUrl string
// CheckoutUrl is the URL to which provider sends customers to finish payment
CheckoutUrl string
State string
PaymentStatus string
Metadata metadata.Metadata
CreatedAt time.Time
UpdatedAt time.Time
ExpireAt time.Time
}
type CreditService ¶
type CustomerService ¶
type FeatureService ¶
type OrganizationService ¶ added in v0.8.13
type PlanService ¶
type Repository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(stripeClient *client.API, stripeAutoTax bool, repository Repository, customerService CustomerService, planService PlanService, subscriptionService SubscriptionService, featureService FeatureService, creditService CreditService, orgService OrganizationService) *Service
type SubscriptionService ¶
type SubscriptionService interface {
List(ctx context.Context, filter subscription.Filter) ([]subscription.Subscription, error)
Create(ctx context.Context, sub subscription.Subscription) (subscription.Subscription, error)
GetByProviderID(ctx context.Context, id string) (subscription.Subscription, error)
}
Click to show internal directories.
Click to hide internal directories.