stripe

package
v0.0.0-...-4a0805c Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2015 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
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.

View Source
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"`
}

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.

see https://stripe.com/docs/api#coupon_object

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.

see https://stripe.com/docs/api#customer_object

func NewCustomer

func NewCustomer() *Customer

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.

see https://stripe.com/docs/api#discount_object

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.

see https://stripe.com/docs/api#plan_object

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"`
}

Subscriptions represents a recurring charge a customer's card.

see https://stripe.com/docs/api#subscription_object

Jump to

Keyboard shortcuts

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