Documentation ¶
Index ¶
- Constants
- Variables
- func IsISOCountryCode(s string) bool
- func Mask(s string) string
- type Article
- type Cart
- type CartItem
- type Catalog
- type Category
- type DeliveredItem
- type Delivery
- type Order
- type OrderRow
- type OrderedArticle
- type OrderedVariant
- type Purchase
- type Status
- type Stock
- func (stock Stock) FeaturedCountryIDs(variant Variant) []string
- func (stock Stock) Get(variant Variant, country string) int
- func (stock Stock) Max(variant Variant, country string) int
- func (stock Stock) OnDemandOnly(variant Variant, country string) bool
- func (stock Stock) OtherCountryIDs(variant Variant) []string
- type Variant
Constants ¶
View Source
const DateFmt = "2006-01-02"
Variables ¶
View Source
var ISOCountryCodes = [...]string{}/* 249 elements not displayed */
ISO-3166-1
Functions ¶
func IsISOCountryCode ¶
Types ¶
type Article ¶
type Article struct { Name string // not translated ID string // for <details> Alert map[string]string Description map[string]string Variants []Variant }
func (Article) TranslateAlert ¶
only supports langs which exist as Alert key, TODO: language.Matcher
type Catalog ¶
type Catalog []Category
func (Catalog) GroupOrder ¶
func (catalog Catalog) GroupOrder(order Order) []OrderedArticle
groups order by article
type DeliveredItem ¶
type DeliveredItem struct { VariantID string `json:"article-id"` // legacy json id CountryID string `json:"country-id"` ID string `json:"id"` // can be the code, but not necessarily Image []byte `json:"image"` DeliveryDate string `json:"delivery-date"` }
func (*DeliveredItem) ImageSrc ¶
func (item *DeliveredItem) ImageSrc() template.URL
type Delivery ¶
type Delivery []DeliveredItem
type OrderRow ¶
type OrderedArticle ¶
type OrderedArticle struct { Article Variants []OrderedVariant }
type OrderedVariant ¶
type Purchase ¶
type Purchase struct { ID string AccessKey string PaymentKey string Status Status NotifyProto string NotifyAddr string Ordered Order Delivered Delivery CreateDate string // yyyy-mm-dd DeleteDate string // yyyy-mm-dd CountryCode string // EU country }
func (*Purchase) GetUnfulfilled ¶
func (*Purchase) Underdelivered ¶
type Status ¶
type Status string
const ( StatusNew Status = "new" // unpaid StatusPaymentProcessing Status = "processing" // e.g. btcpay: "InvoiceProcessing Webhook: Triggers when an invoice is fully paid, but doesn't have the required amount of confirmations on the blockchain yet according to your store's settings." StatusUnderdelivered Status = "underdelivered" // payment settled, but we had not had enough items on stock StatusFinalized Status = "finalized" // payment settled, codes delivered )
type Stock ¶
func (Stock) FeaturedCountryIDs ¶
func (Stock) Max ¶
Max returns the max value which can be ordered (like the HTML input max attribute). The stock quantity should be displayed separately, so users know how many items can be delivered instantly.
func (Stock) OtherCountryIDs ¶
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
Package userdb implements a very simple, read-only user database.
|
Package userdb implements a very simple, read-only user database. |
Click to show internal directories.
Click to hide internal directories.