Documentation ¶
Index ¶
- Constants
- func RunGRPC(port int)
- type Server
- func (s *Server) AttachPaymentMethod(ctx context.Context, request *pb.CreateRequest) (*pb.Empty, error)
- func (s *Server) CreateCustomerFromUser(ctx context.Context, request *pb.CreateRequest) (*pb.CreateResponse, error)
- func (s *Server) GetPlans(ctx context.Context, _ *pb.Empty) (*pb.PlanList, error)
- func (s *Server) GetUserInfo(ctx context.Context, request *pb.InfoRequest) (*pb.Customer, error)
- func (s *Server) SubscribeUser(ctx context.Context, request *pb.SubscribeRequest) (*pb.SubscribeResponse, error)
- func (s *Server) TerminateSubscription(ctx context.Context, request *pb.TerminateRequest) (*pb.Empty, error)
Constants ¶
View Source
const UserMetadataCustomerID = "stripe_customer_id"
UserMetadataCustomerID metadata key for stripe customer id
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server core struct
func NewServer ¶
func NewServer() *Server
NewServer creates a new struct to interface the streams server
func (*Server) AttachPaymentMethod ¶
func (s *Server) AttachPaymentMethod(ctx context.Context, request *pb.CreateRequest) (*pb.Empty, error)
AttachPaymentMethod attaches a payment method to the stripe customer such as a credit card token
func (*Server) CreateCustomerFromUser ¶
func (s *Server) CreateCustomerFromUser(ctx context.Context, request *pb.CreateRequest) (*pb.CreateResponse, error)
CreateCustomerFromUser creates a new stripe customer given a user
func (*Server) GetUserInfo ¶
GetUserInfo fetches the customer info given a user id
func (*Server) SubscribeUser ¶
func (s *Server) SubscribeUser(ctx context.Context, request *pb.SubscribeRequest) (*pb.SubscribeResponse, error)
SubscribeUser subscribes a user/customer to a stripe plan
func (*Server) TerminateSubscription ¶
func (s *Server) TerminateSubscription(ctx context.Context, request *pb.TerminateRequest) (*pb.Empty, error)
TerminateSubscription removes/ends a stripe plan for a customer
Click to show internal directories.
Click to hide internal directories.