Documentation
¶
Index ¶
- Constants
- Variables
- func DisplayPrice(t currency.Type, price currency.Cents) string
- func DisplayTitle(title string) string
- func SplitParagraph(text string) []string
- type Address
- type Adjustment
- type Availability
- type Buyer
- type Event
- type Interval
- type KYCStatus
- type Map
- type MassUnit
- type Media
- type MediaType
Constants ¶
View Source
const ( MediaVideo MediaType = "video" MediaImage = "image" MediaLiveStream = "livestream" MediaWebGL = "webgl" MediaAudio = "audio" MediaEmbed = "embed" )
View Source
const ( MassLbs MassUnit = "lb" MassKilo = "kg" MassGrams = "g" )
Variables ¶
View Source
var BuyerEmailOrPhoneRequired = errors.New("Buyer's Email or Phone is required.")
Functions ¶
func DisplayPrice ¶
DisplayPrice renders a price for a human: symbol, grouped thousands, the currency's own number of decimals ("$1,234.56", "¥10,000").
This is the display funnel — every storefront, order and receipt string in commerce comes through here, so it holds no arithmetic of its own. The amount is rendered from the integer by money, which cannot round a cent away the way the float this used to compute could.
A negative now renders "-$100.00" rather than the old "$-100.00": the sign belongs to the amount, not to the digits after the symbol, and a refund is the most common negative there is.
func SplitParagraph ¶
Types ¶
type Address ¶
type Adjustment ¶
type Availability ¶
type Buyer ¶
type Buyer struct {
Email string `json:"email,omitempty"`
UserId string `json:"userId,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
Company string `json:"company,omitempty"`
Phone string `json:"phone,omitempty"`
// Address Address `json:"address,omitempty"`
ShippingAddress Address `json:"shippingAddress,omitempty"`
BillingAddress Address `json:"billingAddress,omitempty"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.