Documentation
¶
Index ¶
- Variables
- type Address
- type Customer
- type Filter
- type OrgService
- type PaymentMethod
- type Provider
- type Repository
- type Service
- func (s Service) Create(ctx context.Context, customer Customer) (Customer, error)
- func (s Service) Delete(ctx context.Context, id string) error
- func (s Service) GetByID(ctx context.Context, id string) (Customer, error)
- func (s Service) GetByOrgID(ctx context.Context, orgID string) (Customer, error)
- func (s Service) List(ctx context.Context, filter Filter) ([]Customer, error)
- func (s Service) ListPaymentMethods(ctx context.Context, id string) ([]PaymentMethod, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotFound = errors.New("customer not found") ErrInvalidUUID = errors.New("invalid syntax of uuid") ErrInvalidID = errors.New("billing customer id is invalid") ErrConflict = errors.New("customer already exist") ErrInvalidDetail = errors.New("invalid billing customer detail") ErrDisabled = errors.New("billing customer is disabled") )
Functions ¶
This section is empty.
Types ¶
type Customer ¶
type Customer struct {
ID string
OrgID string
ProviderID string // identifier set by the billing engine provider
Name string
Email string
Phone string
Address Address
// Currency Three-letter ISO 4217 currency code in lower case
Currency string `default:"usd"`
Metadata metadata.Metadata
State string
CreatedAt time.Time
UpdatedAt time.Time
DeletedAt *time.Time
}
type OrgService ¶
type OrgService interface {
Get(ctx context.Context, id string) (organization.Organization, error)
}
type PaymentMethod ¶ added in v0.8.13
type Repository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(stripeClient *client.API, repository Repository, orgService OrgService) *Service
func (Service) GetByOrgID ¶
func (Service) ListPaymentMethods ¶ added in v0.8.13
Click to show internal directories.
Click to hide internal directories.