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 ¶
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 ¶
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