Documentation ¶
Index ¶
Constants ¶
const ( AmericanExpress = "American Express" DinersClub = "Diners Club" Discover = "Discover" JCB = "JCB" MasterCard = "MasterCard" Visa = "Visa" UnknownCard = "Unknown" )
Credit Card Types accepted by the Stripe API.
const ( SubscriptionTrialing = "trialing" SubscriptionActive = "active" SubscriptionPastDue = "past_due" SubscriptionCanceled = "canceled" SubscriptionUnpaid = "unpaid" )
Subscription Statuses
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Card ¶
type Card struct { ID string `json:"id"` Name string `json:"name,omitempty"` Type string `json:"type"` ExpMonth int `json:"exp_month"` ExpYear int `json:"exp_year"` Last4 string `json:"last4"` Fingerprint string `json:"fingerprint"` Country string `json:"country,omitempty"` AddrUess1 string `json:"address_line1,omitempty"` Address2 string `json:"address_line2,omitempty"` AddressCountry string `json:"address_country,omitempty"` AddressState string `json:"address_state,omitempty"` AddressZip string `json:"address_zip,omitempty"` AddressCity string `json:"address_city"` AddressLine1Check string `json:"address_line1_check,omitempty"` AddressZipCheck string `json:"address_zip_check,omitempty"` CVCCheck string `json:"cvc_check,omitempty"` }
Card represents details about a Credit Card entered into Stripe.
type CardData ¶
type CardData struct { Object string `json:"object"` Count int `json:"count"` URL string `json:"url"` Data []*Card `json:"data"` }
CardData struct
type Coupon ¶
type Coupon struct { ID string `json:"id"` Duration string `json:"duration"` PercentOff int `json:"percent_off"` DurationInMonths int `json:"duration_in_months,omitempty"` MaxRedemptions int `json:"max_redemptions,omitempty"` RedeemBy int64 `json:"redeem_by,omitempty"` TimesRedeemed int `json:"times_redeemed,omitempty"` Livemode bool `json:"livemode"` }
Coupon represents percent-off discount you might want to apply to a customer.
type Customer ¶
type Customer struct { ID string `json:"id"` Desc string `json:"description,omitempty"` Email string `json:"email,omitempty"` Created int64 `json:"created"` Balance int64 `json:"account_balance"` Delinquent bool `json:"delinquent"` Cards CardData `json:"cards,omitempty"` Discount *Discount `json:"discount,omitempty"` Subscription *Subscription `json:"subscription,omitempty"` Livemode bool `json:"livemode"` DefaultCard string `json:"default_card"` }
Customer encapsulates details about a Customer registered in Stripe.
type Discount ¶
type Discount struct { ID string `json:"id"` Customer string `json:"customer"` Start int64 `json:"start"` End int64 `json:"end"` Coupon *Coupon `json:"coupon"` }
Discount represents the actual application of a coupon to a particular customer.
type Plan ¶
type Plan struct { ID string `json:"id"` Name string `json:"name"` Amount int64 `json:"amount"` Interval string `json:"interval"` IntervalCount int `json:"interval_count"` Currency string `json:"currency"` TrialPeriodDays int `json:"trial_period_days"` Livemode bool `json:"livemode"` }
Plan holds details about pricing information for different products and feature levels on your site. For example, you might have a $10/month plan for basic features and a different $20/month plan for premium features.
type Subscription ¶
type Subscription struct { Customer string `json:"customer"` Status string `json:"status"` Plan *Plan `json:"plan"` Start int64 `json:"start"` EndedAt int64 `json:"ended_at"` CurrentPeriodStart int64 `json:"current_period_start"` CurrentPeriodEnd int64 `json:"current_period_end"` TrialStart int64 `json:"trial_start"` TrialEnd int64 `json:"trial_end"` CanceledAt int64 `json:"canceled_at"` CancelAtPeriodEnd bool `json:"cancel_at_period_end"` Quantity int64 `json:"quantity"` }
Subscription represents a recurring charge a customer's card.