company

package
v5.2.0--beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2018 License: MIT Imports: 10 Imported by: 5

Documentation

Overview

Package company implements functions for handling your company's information. This is for the company name and address, the amount of fees you pay per transaction to Stripe, and the text that is displayed on the credit card statement.

Company data is anything for the company: address, contact info, receipt, statement description, and fees.

Index

Constants

This section is empty.

Variables

View Source
var ErrCompanyDataDoesNotExist = errors.New("company: info does not exist")

ErrCompanyDataDoesNotExist is thrown when no company data has been set yet this occurs when an admin did not go into the settings and provide the company info

Functions

func GetAPI

func GetAPI(w http.ResponseWriter, r *http.Request)

GetAPI is used when viewing the data in the gui or on a receipt

func SaveAPI

func SaveAPI(w http.ResponseWriter, r *http.Request)

SaveAPI saves new or updates existing company info in the datastore

func SaveDefaultInfo

func SaveDefaultInfo(c context.Context) error

SaveDefaultInfo sets some default data when a company first starts using this app This func is called when the initial super admin is created.

Types

type Info

type Info struct {
	CompanyName         string  `json:"company_name"`         //for receipts
	Street              string  `json:"street"`               // " "
	Suite               string  `json:"suite"`                // " "
	City                string  `json:"city"`                 // " "
	State               string  `json:"state"`                // " "
	PostalCode          string  `json:"postal_code"`          // " "
	Country             string  `json:"country"`              // " "
	PhoneNum            string  `json:"phone_num"`            // " "
	Email               string  `json:"email"`                // " "
	PercentFee          float64 `json:"percentage_fee"`       //default is 2.90% transaction per Stripe
	FixedFee            float64 `json:"fixed_fee"`            //default is $0.30 per transaction per Stripe
	StatementDescriptor string  `json:"statement_descriptor"` //what is displayed on the statement with our charge

	//fields not used in cloud datastore
	ID int64 `json:"sqlite_user_id"`
}

Info is the used for setting or getting the company data from the datastore

func Get

func Get(r *http.Request) (Info, error)

Get actually retrienves the information from the datastore putting this into a separate func cleans up code elsewhere

Jump to

Keyboard shortcuts

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