billing

package
v0.0.0-...-0172641 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const UserMetadataCustomerID = "stripe_customer_id"

UserMetadataCustomerID metadata key for stripe customer id

Variables

This section is empty.

Functions

func RunGRPC

func RunGRPC(port int)

RunGRPC starts the GRPC server

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) GetPlans

func (s *Server) GetPlans(ctx context.Context, _ *pb.Empty) (*pb.PlanList, error)

GetPlans queries stripe for all available plans

func (*Server) GetUserInfo

func (s *Server) GetUserInfo(ctx context.Context, request *pb.InfoRequest) (*pb.Customer, error)

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

Directories

Path Synopsis
Package evntsrc_billing is a generated protocol buffer package.
Package evntsrc_billing is a generated protocol buffer package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL