stripe

package module
v0.0.0-...-89929ab Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2014 License: MIT Imports: 10 Imported by: 1

README

Go Stripe

Summary

A Stripe client library written in Go.

Note

This library has been moved to the official Stripe repository.

This repository has been frozen and exists for backwards compatibility for existing clients. It is highly recommended you update your code to use the official client.

The library adheres to Stripe API version 2014-08-20. No future changes are planned in this repository.

Documentation

Overview

Package stripe provides a client for Stripe REST APIs.

Index

Constants

View Source
const (
	TxAvailable TransactionStatus = "available"
	TxPending   TransactionStatus = "pending"

	TxCharge         TransactionType = "charge"
	TxRefund         TransactionType = "refund"
	TxAdjust         TransactionType = "adjustment"
	TxFee            TransactionType = "application_fee"
	TxFeeRefund      TransactionType = "application_fee_refund"
	TxTransfer       TransactionType = "transfer"
	TxTransferCancel TransactionType = "transfer_cancel"
	TxTransferFail   TransactionType = "transfer_failure"
)
View Source
const (
	Unknown    CardBrand = "Unknown"
	Visa       CardBrand = "Visa"
	Amex       CardBrand = "American Express"
	MasterCard CardBrand = "MasterCard"
	Discover   CardBrand = "Discover"
	JCB        CardBrand = "JCB"
	DinersClub CardBrand = "Diners Club"

	Pass      Verification = "pass"
	Fail      Verification = "fail"
	Unchecked Verification = "unchecked"

	CreditFunding  CardFunding = "credit"
	DebitFunding   CardFunding = "debit"
	PrepaidFunding CardFunding = "prepaid"
	UnknownFunding CardFunding = "unknown"
)
View Source
const (
	Duplicate    DisputeReason = "duplicate"
	Fraudulent   DisputeReason = "fraudulent"
	SubCanceled  DisputeReason = "subscription_canceled"
	Unacceptable DisputeReason = "product_unacceptable"
	NotReceived  DisputeReason = "product_not_received"
	Unrecognized DisputeReason = "unrecognized"
	Credit       DisputeReason = "credit_not_processed"
	General      DisputeReason = "general"

	Won             DisputeStatus = "won"
	Lost            DisputeStatus = "lost"
	Response        DisputeStatus = "needs_response"
	Review          DisputeStatus = "under_review"
	WarningResponse DisputeStatus = "warning_needs_response"
	WarningReview   DisputeStatus = "warning_under_review"
	ChargeRefunded  DisputeStatus = "charge_refunded"
)
View Source
const (
	InvalidRequest ErrorType = "invalid_request_error"
	ApiErr         ErrorType = "api_error"
	CardErr        ErrorType = "card_error"

	IncorrectNum  ErrorCode = "incorrect_number"
	InvalidNum    ErrorCode = "invalid_number"
	InvalidExpM   ErrorCode = "invalid_expiry_month"
	InvalidExpY   ErrorCode = "invalid_expiry_year"
	InvalidCvc    ErrorCode = "invalid_cvc"
	ExpiredCard   ErrorCode = "expired_card"
	IncorrectCvc  ErrorCode = "incorrect_cvc"
	IncorrectZip  ErrorCode = "incorrect_zip"
	CardDeclined  ErrorCode = "card_declined"
	Missing       ErrorCode = "missing"
	ProcessingErr ErrorCode = "processing_error"
	RateLimit     ErrorCode = "rate_limit"
)
View Source
const (
	Pending          TransferStatus = "pending"
	Failed           TransferStatus = "failed"
	TransferCanceled TransferStatus = "canceled"

	CardTransfer TransferType = "card"
	BankTransfer TransferType = "bank_account"

	InsufficientFunds    TransferFailCode = "insufficient_funds"
	AccountClosed        TransferFailCode = "account_closed"
	NoAccount            TransferFailCode = "no_account"
	InvalidAccountNumber TransferFailCode = "invalid_account_number"
	DebitNotAuth         TransferFailCode = "debit_not_authorized"
	BankOwnerChanged     TransferFailCode = "bank_ownership_changed"
	AccountFrozen        TransferFailCode = "account_frozen"
	CouldNotProcess      TransferFailCode = "could_not_process"
	BankAccountRestrict  TransferFailCode = "bank_account_restricted"
	InvalidCurrency      TransferFailCode = "invalid_currency"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	Id            string `json:"id"`
	ChargeEnabled bool   `json:"charge_enabled"`
	Country       string `json:"country"`
	// Currencies is the list of supported currencies.
	Currencies       []string `json:"currencies_supported"`
	DefaultCurrency  string   `json:"default_currency"`
	DetailsSubmitted bool     `json:"details_submitted"`
	TransferEnabled  bool     `json:"transfer_enabled"`
	Name             string   `json:"display_name"`
	Email            string   `json:"email"`
	Statement        string   `json:"statement_description"`
	Timezone         string   `json:"timezone"`
}

Account is the resource representing youe Stripe account. For more details see https://stripe.com/docs/api/#account.

type AccountClient

type AccountClient struct {
	// contains filtered or unexported fields
}

AccountClient is the client used to invoke /account APIs.

func (*AccountClient) Get

func (c *AccountClient) Get() (*Account, error)

Get returns the details of your account. For more details see https://stripe.com/docs/api/#retrieve_account.

type Amount

type Amount struct {
	Value    int64    `json:"amount"`
	Currency Currency `json:"currency"`
}

Amount is a structure wrapping an amount value and its currency.

type Api

type Api interface {
	Call(method, path, token string, body *url.Values, v interface{}) error
}

Api is an interface for making calls against a Stripe service. This interface exists to enable mocking for during testing if needed.

type AppFee

type AppFee struct {
	Id             string         `json:"id"`
	Live           bool           `json:"livemode"`
	Account        string         `json:"account"`
	Amount         uint64         `json:"amount"`
	App            string         `json:"application"`
	Tx             string         `json:"balance_transaction"`
	Charge         string         `json:"charge"`
	Created        int64          `json:"created"`
	Currency       Currency       `json:"currency"`
	Refunded       bool           `json:"refunded"`
	Refunds        *FeeRefundList `json:"refunds"`
	AmountRefunded uint64         `json:"amount_refunded"`
}

AppFee is the resource representing a Stripe application fee. For more details see https://stripe.com/docs/api#application_fees.

type AppFeeClient

type AppFeeClient struct {
	// contains filtered or unexported fields
}

AppFeeClient is the client used to invoke application_fees APIs.

func (*AppFeeClient) Get

func (c *AppFeeClient) Get(id string) (*AppFee, error)

Get returns the details of an application fee. For more details see https://stripe.com/docs/api#retrieve_application_fee.

func (*AppFeeClient) List

func (c *AppFeeClient) List(params *AppFeeListParams) (*AppFeeList, error)

List returns a list of application fees. For more details see https://stripe.com/docs/api#list_application_fees.

func (*AppFeeClient) Refund

func (c *AppFeeClient) Refund(id string, params *AppFeeParams) (*FeeRefund, error)

Refund refunds the application fee collected. For more details see https://stripe.com/docs/api#refund_application_fee.

type AppFeeList

type AppFeeList struct {
	Count  uint16    `json:"total_count"`
	More   bool      `json:"has_more"`
	Url    string    `json:"url"`
	Values []*AppFee `json:"data"`
}

AppFeeList is a list object for application fees.

type AppFeeListParams

type AppFeeListParams struct {
	Created            int64
	Filters            Filters
	Charge, Start, End string
	Limit              uint64
}

AppFeeListParams is the set of parameters that can be used when listing application fees. For more details see https://stripe.com/docs/api#list_application_fees.

type AppFeeParams

type AppFeeParams struct {
	Amount uint64
}

AppFeeParams is the set of parameters that can be used when refunding an application fee. For more details see https://stripe.com/docs/api#refund_application_fee.

type Balance

type Balance struct {
	// Live indicates the live mode.
	Live      bool     `json:"livemode"`
	Available []Amount `json:"available"`
	Pending   []Amount `json:"pending"`
}

Balance is the resource representing your Stripe balance. For more details see https://stripe.com/docs/api/#balance.

type BalanceClient

type BalanceClient struct {
	// contains filtered or unexported fields
}

BalaneClient is the client used to invoke /balance and transaction-related APIs.

func (*BalanceClient) Get

func (c *BalanceClient) Get() (*Balance, error)

Get returns the details of your balance. For more details see https://stripe.com/docs/api#retrieve_balance.

func (*BalanceClient) GetTx

func (c *BalanceClient) GetTx(id string) (*Transaction, error)

GetTx returns the details of a balance transaction. For more details see https://stripe.com/docs/api#retrieve_balance_transaction.

func (*BalanceClient) List

func (c *BalanceClient) List(params *TxListParams) (*TransactionList, error)

List returns a list of balance transactions. For more details see https://stripe.com/docs/api#balance_history.

type BankAccount

type BankAccount struct {
	Id          string   `json:"id"`
	Name        string   `json:"bank_name"`
	Country     string   `json:"country"`
	Currency    Currency `json:"currency"`
	LastFour    string   `json:"last4"`
	Disabled    bool     `json:"disabled"`
	Fingerprint string   `json:"fingerprint"`
	Valid       bool     `json:"validated"`
}

BankAccount represents a Stripe bank account.

type BankAccountParams

type BankAccountParams struct {
	Country, Routing, Account string
}

BankAccountParams is the set of parameters that can be used when creating or updating a bank account.

type CaptureParams

type CaptureParams struct {
	Amount, Fee        uint64
	Email, AccessToken string
}

CaptureParams is the set of parameters that can be used when capturing a charge. For more details see https://stripe.com/docs/api#charge_capture.

type Card

type Card struct {
	Id            string       `json:"id"`
	Month         uint8        `json:"exp_month"`
	Year          uint16       `json:"exp_year"`
	Fingerprint   string       `json:"fingerprint"`
	Funding       CardFunding  `json:"funding"`
	LastFour      string       `json:"last4"`
	Brand         CardBrand    `json:"brand"`
	City          string       `json:"address_city"`
	Country       string       `json:"address_country"`
	Address1      string       `json:"address_line1"`
	Address1Check Verification `json:"address_line1_check"`
	Address2      string       `json:"address_line2"`
	State         string       `json:"address_state"`
	Zip           string       `json:"address_zip"`
	ZipCheck      Verification `json:"address_zip_check"`
	CardCountry   string       `json:"country"`
	Customer      string       `json:"customer"`
	CVCCheck      Verification `json:"cvc_check"`
	Name          string       `json:"name"`
	Recipient     string       `json:"recipient"`
}

Card is the resource representing a Stripe credit/debit card. For more details see https://stripe.com/docs/api#cards.

type CardBrand

type CardBrand string

CardBrand is the list of allowed values for the card's brand. Allowed values are "Unknown", "Visa", "American Express", "MasterCard", "Discover" "JCB", "Diners Club".

type CardClient

type CardClient struct {
	// contains filtered or unexported fields
}

CardClient is the client used to invoke /cards APIs.

func (*CardClient) Create

func (c *CardClient) Create(params *CardParams) (*Card, error)

Create POSTs new cards either for a customer or recipient. For more details see https://stripe.com/docs/api#create_card.

func (*CardClient) Delete

func (c *CardClient) Delete(id string, params *CardParams) error

Delete remotes a card. For more details see https://stripe.com/docs/api#delete_card.

func (*CardClient) Get

func (c *CardClient) Get(id string, params *CardParams) (*Card, error)

Get returns the details of a card. For more details see https://stripe.com/docs/api#retrieve_card.

func (*CardClient) List

func (c *CardClient) List(params *CardListParams) (*CardList, error)

List returns a list of cards. For more details see https://stripe.com/docs/api#list_cards.

func (*CardClient) Update

func (c *CardClient) Update(id string, params *CardParams) (*Card, error)

Update updates a card's properties. For more details see https://stripe.com/docs/api#update_card.

type CardFunding

type CardFunding string

CardFunding is the list of allowed values for the card's funding. Allowed values are "credit", "debit", "prepaid", "unknown".

type CardList

type CardList struct {
	Count  uint16  `json:"total_count"`
	More   bool    `json:"has_more"`
	Url    string  `json:"url"`
	Values []*Card `json:"data"`
}

CardList is a list object for cards.

type CardListParams

type CardListParams struct {
	Customer, Recipient string
	Filters             Filters
	Start, End          string
	Limit               uint64
}

CardListParams is the set of parameters that can be used when listing cards. For more details see https://stripe.com/docs/api#list_cards.

type CardParams

type CardParams struct {
	Token                                         string
	Customer, Recipient                           string
	Name, Number, Month, Year, CVC                string
	Address1, Address2, City, State, Zip, Country string
}

CardParams is the set of parameters that can be used when creating or updating a card. For more details see https://stripe.com/docs/api#create_card and https://stripe.com/docs/api#update_card.

type Charge

type Charge struct {
	Id             string            `json:"id"`
	Live           bool              `json:"livemode"`
	Amount         uint64            `json:"amount"`
	Captured       bool              `json:"captured"`
	Card           *Card             `json:"card"`
	Created        int64             `json:"created"`
	Currency       Currency          `json:"currency"`
	Paid           bool              `json:"paid"`
	Refunded       bool              `json:"refunded"`
	Refunds        *RefundList       `json:"refunds"`
	AmountRefunded uint64            `json:"amount_refunded"`
	Tx             string            `json:"balance_transaction"`
	Customer       string            `json:"customer"`
	Desc           string            `json:"description"`
	Dispute        *Dispute          `json:"dispute"`
	FailMsg        string            `json:"failure_message"`
	FailCode       string            `json:"failure_code"`
	Invoice        string            `json:"invoice"`
	Meta           map[string]string `json:"metadata"`
	Email          string            `json:"receipt_email"`
	Statement      string            `json:"statement_description"`
}

Charge is the resource representing a Stripe charge. For more details see https://stripe.com/docs/api#charges.

type ChargeClient

type ChargeClient struct {
	// contains filtered or unexported fields
}

ChargeClient is the client used to invoke /charges APIs.

func (*ChargeClient) Capture

func (c *ChargeClient) Capture(id string, params *CaptureParams) (*Charge, error)

Capture captures a previously created charge with NoCapture set to true. For more details see https://stripe.com/docs/api#charge_capture.

func (*ChargeClient) Create

func (c *ChargeClient) Create(params *ChargeParams) (*Charge, error)

Create POSTs new charges. For more details see https://stripe.com/docs/api#create_charge.

func (*ChargeClient) Get

func (c *ChargeClient) Get(id string) (*Charge, error)

Get returns the details of a charge. For more details see https://stripe.com/docs/api#retrieve_charge.

func (*ChargeClient) List

func (c *ChargeClient) List(params *ChargeListParams) (*ChargeList, error)

List returns a list of charges. For more details see https://stripe.com/docs/api#list_charges.

func (*ChargeClient) Refund

func (c *ChargeClient) Refund(params *RefundParams) (*Refund, error)

Refund refunds a charge previously created. For more details see https://stripe.com/docs/api#refund_charge.

func (*ChargeClient) Update

func (c *ChargeClient) Update(id string, params *ChargeParams) (*Charge, error)

Update updates a charge's properties. For more details see https://stripe.com/docs/api#update_charge.

type ChargeList

type ChargeList struct {
	Count  uint16    `json:"total_count"`
	More   bool      `json:"has_more"`
	Url    string    `json:"url"`
	Values []*Charge `json:"data"`
}

ChargeList is a list object for charges.

type ChargeListParams

type ChargeListParams struct {
	Created              int64
	Filters              Filters
	Customer, Start, End string
	Limit                uint64
}

ChargeListParams is the set of parameters that can be used when listing charges. For more details see https://stripe.com/docs/api#list_charges.

type ChargeParams

type ChargeParams struct {
	Amount                              uint64
	Currency                            Currency
	Customer, Token                     string
	Card                                *CardParams
	Desc, Statement, AccessToken, Email string
	Meta                                map[string]string
	NoCapture                           bool
	Fee                                 uint64
}

ChargeParams is the set of parameters that can be used when creating or updating a charge. For more details see https://stripe.com/docs/api#create_charge and https://stripe.com/docs/api#update_charge.

type Client

type Client struct {
	// Token is the secret key used for authentication.
	Token string

	// Charges is the client used to invoke /charges APIs.
	// For more details see https://stripe.com/docs/api/#charges.
	Charges *ChargeClient
	// Customers is the client used to invoke /customers APIs.
	// For more details see https://stripe.com/docs/api/#customers.
	Customers *CustomerClient
	// Cards is the client used to invoke /cards APIs.
	// For more details see https://stripe.com/docs/api/#cards.
	Cards *CardClient
	// Subs is the client used to invoke /subscriptions APIs.
	// For more details see https://stripe.com/docs/api/#subscriptions.
	Subs *SubscriptionClient
	// Plans is the client used to invoke /plans APIs.
	// For more details see https://stripe.com/docs/api/#plans.
	Plans *PlanClient
	// Coupons is the client used to invoke /coupons APIs.
	// For more details see https://stripe.com/docs/api/#coupons.
	Coupons *CouponClient
	// Discounts is the client used to invoke discount-related APIs.
	// For mode details see https://stripe.com/docs/api/#discounts.
	Discounts *DiscountClient
	// Invoices is the client used to invoke /invoices APIs.
	// For more details see https://stripe.com/docs/api/#invoices.
	Invoices *InvoiceClient
	// InvoiceItems is the client used to invoke /invoiceitems APIs.
	// For more details see https://stripe.com/docs/api/#invoiceitems.
	InvoiceItems *InvoiceItemClient
	// Disputes is the client used to invoke dispute-related APIs.
	// For more details see https://stripe.com/docs/api/#disputes.
	Disputes *DisputeClient
	// Transfers is the client used to invoke /transfers APIs.
	// For more details see https://stripe.com/docs/api/#transfers.
	Transfers *TransferClient
	// Recipients is the client used to invoke /recipients APIs.
	// For more details see https://stripe.com/docs/api/#recipients.
	Recipients *RecipientClient
	// Refunds is the client used to invoke /refunds APIs.
	// For more details see https://stripe.com/docs/api#refunds.
	Refunds *RefundClient
	// Fees is the client used to invoke /application_fees APIs.
	// For more details see https://stripe.com/docs/api/#application_fees.
	Fees *AppFeeClient
	// FeeRefunds is the client used to invoke /application_fees/refunds APIs.
	// For more details see https://stripe.com/docs/api/#fee_refundss.
	FeeRefunds *FeeRefundClient
	// Account is the client used to invoke /account APIs.
	// For more details see https://stripe.com/docs/api/#account.
	Account *AccountClient
	// Balance is the client used to invoke /balance and transaction-related APIs.
	// For more details see https://stripe.com/docs/api/#balance.
	Balance *BalanceClient
	// Events is the client used to invoke /events APIs.
	// For more details see https://stripe.com/docs/api#events.
	Events *EventClient
	// Tokens is the client used to invoke /tokens APIs.
	// For more details see https://stripe.com/docs/api/#tokens.
	Tokens *TokenClient
	// contains filtered or unexported fields
}

Client is the Stripe client. It contains all the different resources available.

func (*Client) Init

func (c *Client) Init(token string, client *http.Client, api Api)

Init initializes the Stripe client with the appropriate token secret key as well as providing the ability to override the HTTP client and api used.

func (*Client) SetDebug

func (c *Client) SetDebug(value bool)

SetDebug enables additional tracing globally. The method is designed for used during testing.

type Coupon

type Coupon struct {
	Id             string            `json:"id"`
	Live           bool              `json:"livemode"`
	Created        int64             `json:"created"`
	Duration       CouponDuration    `json:"duration"`
	Amount         uint64            `json:"amount_off"`
	Currency       Currency          `json:"currency"`
	DurationPeriod uint64            `json:"duration_in_months"`
	Redemptions    uint64            `json:"max_redemptions"`
	Meta           map[string]string `json:"metadata"`
	Percent        uint64            `json:"percent_off"`
	RedeemBy       int64             `json:"redeem_by"`
	Redeemed       uint64            `json:"times_redeemed"`
	Valid          bool              `json:"valid"`
}

Coupon is the resource representing a Stripe coupon. For more details see https://stripe.com/docs/api#coupons.

type CouponClient

type CouponClient struct {
	// contains filtered or unexported fields
}

CouponClient is the client used to invoke /coupons APIs.

func (*CouponClient) Create

func (c *CouponClient) Create(params *CouponParams) (*Coupon, error)

Create POSTs new coupons. For more details see https://stripe.com/docs/api#create_coupon.

func (*CouponClient) Delete

func (c *CouponClient) Delete(id string) error

Delete removes a coupon. For more details see https://stripe.com/docs/api#delete_coupon.

func (*CouponClient) Get

func (c *CouponClient) Get(id string) (*Coupon, error)

Get returns the details of a coupon. For more details see https://stripe.com/docs/api#retrieve_coupon.

func (*CouponClient) List

func (c *CouponClient) List(params *CouponListParams) (*CouponList, error)

List returns a list of coupons. For more details see https://stripe.com/docs/api#list_coupons.

type CouponDuration

type CouponDuration string

CouponDuration is the list of allowed values for the coupon's duration. Allowed values are "forever", "once", "repeating".

const (
	Forever   CouponDuration = "forever"
	Once      CouponDuration = "once"
	Repeating CouponDuration = "repeating"
)

type CouponList

type CouponList struct {
	Count  uint16    `json:"total_count"`
	More   bool      `json:"has_more"`
	Url    string    `json:"url"`
	Values []*Coupon `json:"data"`
}

CouponList is a list object for coupons.

type CouponListParams

type CouponListParams struct {
	Filters    Filters
	Start, End string
	Limit      uint64
}

CouponListParams is the set of parameters that can be used when listing coupons. For more detail see https://stripe.com/docs/api#list_coupons.

type CouponParams

type CouponParams struct {
	Duration                                     CouponDuration
	Id                                           string
	Currency                                     Currency
	Amount, Percent, DurationPeriod, Redemptions uint64
	Meta                                         map[string]string
	RedeemBy                                     int64
}

CouponParams is the set of parameters that can be used when creating a coupon. For more details see https://stripe.com/docs/api#create_coupon.

type Currency

type Currency string

Currency is the list of supported currencies. For more details see https://support.stripe.com/questions/which-currencies-does-stripe-support.

const (
	AED Currency = "aed" // United Arab Emirates Dirham
	AFN Currency = "afn" // Afghan Afghani
	ALL Currency = "all" // Albanian Lek
	AMD Currency = "amd" // Armenian Dram
	ANG Currency = "ang" // Netherlands Antillean Gulden
	AOA Currency = "aoa" // Angolan Kwanza
	ARS Currency = "ars" // Argentine Peso
	AUD Currency = "aud" // Australian Dollar
	AWG Currency = "awg" // Aruban Florin
	AZN Currency = "azn" // Azerbaijani Manat
	BAM Currency = "bam" // Bosnia & Herzegovina Convertible Mark
	BBD Currency = "bbd" // Barbadian Dollar
	BDT Currency = "bdt" // Bangladeshi Taka
	BGN Currency = "bgn" // Bulgarian Lev
	BIF Currency = "bif" // Burundian Franc
	BMD Currency = "bmd" // Bermudian Dollar
	BND Currency = "bnd" // Brunei Dollar
	BOB Currency = "bob" // Bolivian Boliviano
	BRL Currency = "brl" // Brazilian Real
	BSD Currency = "bsd" // Bahamian Dollar
	BWP Currency = "bwp" // Botswana Pula
	BZD Currency = "bzd" // Belize Dollar
	CAD Currency = "cad" // Canadian Dollar
	CDF Currency = "cdf" // Congolese Franc
	CHF Currency = "chf" // Swiss Franc
	CLP Currency = "clp" // Chilean Peso
	CNY Currency = "cny" // Chinese Renminbi Yuan
	COP Currency = "cop" // Colombian Peso
	CRC Currency = "crc" // Costa Rican Colón
	CVE Currency = "cve" // Cape Verdean Escudo
	CZK Currency = "czk" // Czech Koruna
	DJF Currency = "djf" // Djiboutian Franc
	DKK Currency = "dkk" // Danish Krone
	DOP Currency = "dop" // Dominican Peso
	DZD Currency = "dzd" // Algerian Dinar
	EEK Currency = "eek" // Estonian Kroon
	EGP Currency = "egp" // Egyptian Pound
	ETB Currency = "etb" // Ethiopian Birr
	EUR Currency = "eur" // Euro
	FJD Currency = "fjd" // Fijian Dollar
	FKP Currency = "fkp" // Falkland Islands Pound
	GBP Currency = "gbp" // British Pound
	GEL Currency = "gel" // Georgian Lari
	GIP Currency = "gip" // Gibraltar Pound
	GMD Currency = "gmd" // Gambian Dalasi
	GNF Currency = "gnf" // Guinean Franc
	GTQ Currency = "gtq" // Guatemalan Quetzal
	GYD Currency = "gyd" // Guyanese Dollar
	HKD Currency = "hkd" // Hong Kong Dollar
	HNL Currency = "hnl" // Honduran Lempira
	HRK Currency = "hrk" // Croatian Kuna
	HTG Currency = "htg" // Haitian Gourde
	HUF Currency = "huf" // Hungarian Forint
	IDR Currency = "idr" // Indonesian Rupiah
	ILS Currency = "ils" // Israeli New Sheqel
	INR Currency = "inr" // Indian Rupee
	ISK Currency = "isk" // Icelandic Króna
	JMD Currency = "jmd" // Jamaican Dollar
	JPY Currency = "jpy" // Japanese Yen
	KES Currency = "kes" // Kenyan Shilling
	KGS Currency = "kgs" // Kyrgyzstani Som
	KHR Currency = "khr" // Cambodian Riel
	KMF Currency = "kmf" // Comorian Franc
	KRW Currency = "krw" // South Korean Won
	KYD Currency = "kyd" // Cayman Islands Dollar
	KZT Currency = "kzt" // Kazakhstani Tenge
	LAK Currency = "lak" // Lao Kip
	LBP Currency = "lbp" // Lebanese Pound
	LKR Currency = "lkr" // Sri Lankan Rupee
	LRD Currency = "lrd" // Liberian Dollar
	LSL Currency = "lsl" // Lesotho Loti
	LTL Currency = "ltl" // Lithuanian Litas
	LVL Currency = "lvl" // Latvian Lats
	MAD Currency = "mad" // Moroccan Dirham
	MDL Currency = "mdl" // Moldovan Leu
	MGA Currency = "mga" // Malagasy Ariary
	MKD Currency = "mkd" // Macedonian Denar
	MNT Currency = "mnt" // Mongolian Tögrög
	MOP Currency = "mop" // Macanese Pataca
	MRO Currency = "mro" // Mauritanian Ouguiya
	MUR Currency = "mur" // Mauritian Rupee
	MVR Currency = "mvr" // Maldivian Rufiyaa
	MWK Currency = "mwk" // Malawian Kwacha
	MXN Currency = "mxn" // Mexican Peso
	MYR Currency = "myr" // Malaysian Ringgit
	MZN Currency = "mzn" // Mozambican Metical
	NAD Currency = "nad" // Namibian Dollar
	NGN Currency = "ngn" // Nigerian Naira
	NIO Currency = "nio" // Nicaraguan Córdoba
	NOK Currency = "nok" // Norwegian Krone
	NPR Currency = "npr" // Nepalese Rupee
	NZD Currency = "nzd" // New Zealand Dollar
	PAB Currency = "pab" // Panamanian Balboa
	PEN Currency = "pen" // Peruvian Nuevo Sol
	PGK Currency = "pgk" // Papua New Guinean Kina
	PHP Currency = "php" // Philippine Peso
	PKR Currency = "pkr" // Pakistani Rupee
	PLN Currency = "pln" // Polish Złoty
	PYG Currency = "pyg" // Paraguayan Guaraní
	QAR Currency = "qar" // Qatari Riyal
	RON Currency = "ron" // Romanian Leu
	RSD Currency = "rsd" // Serbian Dinar
	RUB Currency = "rub" // Russian Ruble
	RWF Currency = "rwf" // Rwandan Franc
	SAR Currency = "sar" // Saudi Riyal
	SBD Currency = "sbd" // Solomon Islands Dollar
	SCR Currency = "scr" // Seychellois Rupee
	SEK Currency = "sek" // Swedish Krona
	SGD Currency = "sgd" // Singapore Dollar
	SHP Currency = "shp" // Saint Helenian Pound
	SLL Currency = "sll" // Sierra Leonean Leone
	SOS Currency = "sos" // Somali Shilling
	SRD Currency = "srd" // Surinamese Dollar
	STD Currency = "std" // São Tomé and Príncipe Dobra
	SVC Currency = "svc" // Salvadoran Colón
	SZL Currency = "szl" // Swazi Lilangeni
	THB Currency = "thb" // Thai Baht
	TJS Currency = "tjs" // Tajikistani Somoni
	TOP Currency = "top" // Tongan Paʻanga
	TRY Currency = "try" // Turkish Lira
	TTD Currency = "ttd" // Trinidad and Tobago Dollar
	TWD Currency = "twd" // New Taiwan Dollar
	TZS Currency = "tzs" // Tanzanian Shilling
	UAH Currency = "uah" // Ukrainian Hryvnia
	UGX Currency = "ugx" // Ugandan Shilling
	USD Currency = "usd" // United States Dollar
	UYU Currency = "uyu" // Uruguayan Peso
	UZS Currency = "uzs" // Uzbekistani Som
	VEF Currency = "vef" // Venezuelan Bolívar
	VND Currency = "vnd" // Vietnamese Đồng
	VUV Currency = "vuv" // Vanuatu Vatu
	WST Currency = "wst" // Samoan Tala
	XAF Currency = "xaf" // Central African Cfa Franc
	XCD Currency = "xcd" // East Caribbean Dollar
	XOF Currency = "xof" // West African Cfa Franc
	XPF Currency = "xpf" // Cfp Franc
	YER Currency = "yer" // Yemeni Rial
	ZAR Currency = "zar" // South African Rand
	ZMW Currency = "zmw" // Zambian Kwacha
)

type Customer

type Customer struct {
	Id          string            `json:"id"`
	Live        bool              `json:"livemode"`
	Cards       *CardList         `json:"cards"`
	Created     int64             `json:"created"`
	Balance     int64             `json:"account_balance"`
	Currency    Currency          `json:"currency"`
	DefaultCard string            `json:"default_card"`
	Delinquent  bool              `json:"delinquent"`
	Desc        string            `json:"description"`
	Discount    *Discount         `json:"discount"`
	Email       string            `json:"email"`
	Meta        map[string]string `json:"metadata"`
	Subs        *SubscriptionList `json:"subscriptions"`
}

Customer is the resource representing a Stripe customer. For more details see https://stripe.com/docs/api#customers.

type CustomerClient

type CustomerClient struct {
	// contains filtered or unexported fields
}

CustomerClient is the client used to invoke /customers APIs.

func (*CustomerClient) Create

func (c *CustomerClient) Create(params *CustomerParams) (*Customer, error)

Create POSTs new customers. For more details see https://stripe.com/docs/api#create_customer.

func (*CustomerClient) Delete

func (c *CustomerClient) Delete(id string) error

Delete removes a customer. For more details see https://stripe.com/docs/api#delete_customer.

func (*CustomerClient) Get

func (c *CustomerClient) Get(id string) (*Customer, error)

Get returns the details of a customer. For more details see https://stripe.com/docs/api#retrieve_customer.

func (*CustomerClient) List

func (c *CustomerClient) List(params *CustomerListParams) (*CustomerList, error)

List returns a list of customers. For more details see https://stripe.com/docs/api#list_customers.

func (*CustomerClient) Update

func (c *CustomerClient) Update(id string, params *CustomerParams) (*Customer, error)

Update updates a customer's properties. For more details see https://stripe.com/docs/api#update_customer.

type CustomerList

type CustomerList struct {
	Count  uint16      `json:"total_count"`
	More   bool        `json:"has_more"`
	Url    string      `json:"url"`
	Values []*Customer `json:"data"`
}

CustomerList is a list object for customers.

type CustomerListParams

type CustomerListParams struct {
	Created    int64
	Filters    Filters
	Start, End string
	Limit      uint64
}

CustomerListParams is the set of parameters that can be used when listing customers. For more details see https://stripe.com/docs/api#list_customers.

type CustomerParams

type CustomerParams struct {
	Balance       int64
	Token, Coupon string
	Card          *CardParams
	Desc, Email   string
	Meta          map[string]string
	Plan          string
	Quantity      uint64
	TrialEnd      int64
	DefaultCard   string
}

CustomerParams is the set of parameters that can be used when creating or updating a customer. For more details see https://stripe.com/docs/api#create_customer and https://stripe.com/docs/api#update_customer.

type Discount

type Discount struct {
	Coupon   *Coupon `json:"coupon"`
	Customer string  `json:"customer"`
	Start    int64   `json:"start"`
	End      int64   `json:"end"`
	Sub      string  `json:"subscription"`
}

Discount is the resource representing a Stripe discount. For more details see https://stripe.com/docs/api#discounts.

type DiscountClient

type DiscountClient struct {
	// contains filtered or unexported fields
}

DiscountClient is the client used to invoke discount-related APIs.

func (*DiscountClient) Delete

func (c *DiscountClient) Delete(customerId string) error

Delete removes a discount from a customer. For more details see https://stripe.com/docs/api#delete_discount.

func (*DiscountClient) DeleteSubscription

func (c *DiscountClient) DeleteSubscription(customerId, subscriptionid string) error

DeleteSubscription removes a discount from a customer's subscription. For more details see https://stripe.com/docs/api#delete_subscription_discount.

type Dispute

type Dispute struct {
	Live         bool              `json:"livemode"`
	Amount       uint64            `json:"amount"`
	Currency     Currency          `json:"currency"`
	Charge       string            `json:"charge"`
	Created      int64             `json:"created"`
	Reason       DisputeReason     `json:"reason"`
	Status       DisputeStatus     `json:"status"`
	Transactions []*Transaction    `json:"balance_transactions"`
	Evidence     string            `json:"evidence"`
	DueDate      int64             `json:"evidence_due_by"`
	Meta         map[string]string `json:"metadata"`
}

Dispute is the resource representing a Stripe dispute. For more details see https://stripe.com/docs/api#disputes.

type DisputeClient

type DisputeClient struct {
	// contains filtered or unexported fields
}

DisputeClient is the client used to invoke dispute-related APIs.

func (*DisputeClient) Close

func (c *DisputeClient) Close(id string) (*Dispute, error)

Close dismisses a dispute in the customer's favor. For more details see https://stripe.com/docs/api#close_dispute.

func (*DisputeClient) Update

func (c *DisputeClient) Update(id string, params *DisputeParams) (*Dispute, error)

Update updates a charge's dispute. For more details see https://stripe.com/docs/api#update_dispute.

type DisputeParams

type DisputeParams struct {
	Evidence string
	Meta     map[string]string
}

DisputeParams is the set of parameters that can be used when updating a dispute. For more details see https://stripe.com/docs/api#update_dispute.

type DisputeReason

type DisputeReason string

DisputeReason is the list of allowed values for a discount's reason. Allowed values are "duplicate", "fraudulent", "subscription_canceled", "product_unacceptable", "product_not_received", "unrecognized", "credit_not_processed", "general".

type DisputeStatus

type DisputeStatus string

DisputeStatus is the list of allowed values for a discount's status. Allowed values are "won", "lost", "needs_ressponse", "under_review", "warning_needs_response", "warning_under_review", "charge_refunded".

type Error

type Error struct {
	Type  ErrorType `json:"type"`
	Msg   string    `json:"message"`
	Code  ErrorCode `json:"code,omitempty"`
	Param string    `json:"param,omitempty"`
}

Error is the response returned when a call is unsuccessful. For more details see https://stripe.com/docs/api#errors.

func (*Error) Error

func (e *Error) Error() string

Error serializes the Error object and prints the JSON string.

type ErrorCode

type ErrorCode string

ErrorCode is the list of allowed values for the error's code. Allowed values are "incorrect_number", "invalid_number", "invalid_expiry_month", "invalid_expiry_year", "invalid_cvc", "expired_card", "incorrect_cvc", "incorrect_zip", "card_declined", "missing", "processing_error", "rate_limit".

type ErrorType

type ErrorType string

ErrorType is the list of allowed values for the error's type. Allowed values are "invalid_request_error", "api_error", "card_error".

type Event

type Event struct {
	Id       string     `json:"id"`
	Live     bool       `json:"livemode"`
	Created  int64      `json:"created"`
	Data     *EventData `json:"data"`
	Webhooks uint64     `json:"pending_webhooks"`
	Type     string     `json:"type"`
	Req      string     `json:"request"`
}

Event is the resource representing a Stripe event. For more details see https://stripe.com/docs/api#events.

func (*Event) GetObjValue

func (e *Event) GetObjValue(keys ...string) string

GetObjValue returns the value from the e.Data.Obj bag based on the keys hierarchy.

func (*Event) GetPrevValue

func (e *Event) GetPrevValue(keys ...string) string

GetPrevValue returns the value from the e.Data.Prev bag based on the keys hierarchy.

type EventClient

type EventClient struct {
	// contains filtered or unexported fields
}

EventClient is the client used to invoke /events APIs.

func (*EventClient) Get

func (c *EventClient) Get(id string) (*Event, error)

Get returns the details of an event For more details see https://stripe.com/docs/api#retrieve_event.

func (*EventClient) List

func (c *EventClient) List(params *EventListParams) (*EventList, error)

List returns a list of events. For more details see https://stripe.com/docs/api#list_events

type EventData

type EventData struct {
	Obj  map[string]interface{} `json:"object"`
	Prev map[string]interface{} `json:"previous_attributes"`
}

EventData is the unmarshalled object as a map.

type EventList

type EventList struct {
	Count  uint16   `json:"total_count"`
	More   bool     `json:"has_more"`
	Url    string   `json:"url"`
	Values []*Event `json:"data"`
}

EventList is a list object for events.

type EventListParams

type EventListParams struct {
	Created    int64
	Filters    Filters
	Start, End string
	Limit      uint64
	// Type is one of the values documented at https://stripe.com/docs/api#event_types.
	Type string
}

EventListParams is the set of parameters that can be used when listing events. For more details see https://stripe.com/docs/api#list_events.

type Fee

type Fee struct {
	Amount      int64    `json:"amount"`
	Currency    Currency `json:"currency"`
	Type        string   `json:"type"`
	Desc        string   `json:"description"`
	Application string   `json:"application"`
}

Fee is a structure that breaks down the fees in a transaction.

type FeeRefund

type FeeRefund struct {
	Id       string            `json:"id"`
	Amount   uint64            `json:"amount"`
	Created  int64             `json:"created"`
	Currency Currency          `json:"currency"`
	Tx       string            `json:"balance_transaction"`
	Fee      string            `json:"fee"`
	Meta     map[string]string `json:"metadata"`
}

FeeRefund is the resource representing a Stripe fee refund. For more details see https://stripe.com/docs/api#fee_refunds.

type FeeRefundClient

type FeeRefundClient struct {
	// contains filtered or unexported fields
}

FeeRefundClient is the client used to invoke /application_fees/refunds APIs.

func (*FeeRefundClient) Get

func (c *FeeRefundClient) Get(id string, params *FeeRefundParams) (*FeeRefund, error)

Get returns the details of a fee refund. For more details see https://stripe.com/docs/api#retrieve_fee_refund.

func (*FeeRefundClient) List

List returns a list of fee refunds. For more details see https://stripe.com/docs/api#list_fee_refunds.

func (*FeeRefundClient) Update

func (c *FeeRefundClient) Update(id string, params *FeeRefundParams) (*FeeRefund, error)

Update updates a refund's properties. For more details see https://stripe.com/docs/api#update_refund.

type FeeRefundList

type FeeRefundList struct {
	Count  uint16       `json:"total_count"`
	More   bool         `json:"has_more"`
	Url    string       `json:"url"`
	Values []*FeeRefund `json:"data"`
}

FeeRefundist is a list object for fee refunds.

type FeeRefundListParams

type FeeRefundListParams struct {
	Fee        string
	Filters    Filters
	Start, End string
	Limit      uint64
}

FeeRefundListParams is the set of parameters that can be used when listing fee refunds. For more details see https://stripe.com/docs/api#list_fee_refunds.

type FeeRefundParams

type FeeRefundParams struct {
	Fee    string
	Amount uint64
	Meta   map[string]string
}

FeeRefundParams is the set of parameters that can be used when refunding a fee. For more details see https://stripe.com/docs/api#fee_refund.

type Filters

type Filters struct {
	// contains filtered or unexported fields
}

Filters is a structure that contains a collection of filters for list-related APIs.

func (*Filters) AddFilter

func (f *Filters) AddFilter(key, op, value string)

AddFilter adds a new filter with a given key, op and value.

type Invoice

type Invoice struct {
	Id           string            `json:"id"`
	Live         bool              `json:"livemode"`
	Amount       int64             `json:"amount_due"`
	Attempts     uint64            `json:"attempt_count"`
	Attempted    bool              `json:"attempted"`
	Closed       bool              `json:"closed"`
	Currency     Currency          `json:"currency"`
	Customer     string            `json:"customer"`
	Date         int64             `json:"date"`
	Forgive      bool              `json:"forgiven"`
	Lines        *InvoiceLineList  `json:"lines"`
	Paid         bool              `json:"paid"`
	End          int64             `json:"period_end"`
	Start        int64             `json:"period_start"`
	StartBalance int64             `json:"starting_balance"`
	Subtotal     int64             `json:"subtotal"`
	Total        int64             `json:"total"`
	Fee          uint64            `json:"application_fee"`
	Charge       string            `json:"charge"`
	Desc         string            `json:"description"`
	Discount     *Discount         `json:"discount"`
	EndBalance   int64             `json:"ending_balance"`
	NextAttempt  int64             `json:"next_payment_attempt"`
	Statement    string            `json:"statement_description"`
	Sub          string            `json:"subscription"`
	Webhook      int64             `json:"webhooks_delivered_at"`
	Meta         map[string]string `json:"metadata"`
}

Invoice is the resource representing a Stripe invoice. For more details see https://stripe.com/docs/api#invoice_object.

type InvoiceClient

type InvoiceClient struct {
	// contains filtered or unexported fields
}

InvoiceClient is the client used to invoke /invoices APIs.

func (*InvoiceClient) Create

func (c *InvoiceClient) Create(params *InvoiceParams) (*Invoice, error)

Create POSTs new invoices. For more details see https://stripe.com/docs/api#create_invoice.

func (*InvoiceClient) Get

func (c *InvoiceClient) Get(id string) (*Invoice, error)

Get returns the details of an invoice. For more details see https://stripe.com/docs/api#retrieve_invoice.

func (*InvoiceClient) GetNext

func (c *InvoiceClient) GetNext(params *InvoiceParams) (*Invoice, error)

GetNext returns the upcoming invoice's properties. For more details see https://stripe.com/docs/api#retrieve_customer_invoice.

func (*InvoiceClient) List

func (c *InvoiceClient) List(params *InvoiceListParams) (*InvoiceList, error)

List returns a list of invoices. For more details see https://stripe.com/docs/api#list_customer_invoices.

func (*InvoiceClient) ListLines

func (c *InvoiceClient) ListLines(params *InvoiceLineListParams) (*InvoiceLineList, error)

ListLines returns a list of line items. For more details see https://stripe.com/docs/api#invoice_lines.

func (*InvoiceClient) Pay

func (c *InvoiceClient) Pay(id string) (*Invoice, error)

Pay pays an invoice. For more details see https://stripe.com/docs/api#pay_invoice.

func (*InvoiceClient) Update

func (c *InvoiceClient) Update(id string, params *InvoiceParams) (*Invoice, error)

Update updates an invoice's properties. For more details see https://stripe.com/docs/api#update_invoice.

type InvoiceItem

type InvoiceItem struct {
	Id        string            `json:"id"`
	Live      bool              `json:"livemode"`
	Amount    int64             `json:"amount"`
	Currency  Currency          `json:"currency"`
	Customer  string            `json:"customer"`
	Date      int64             `json:"date"`
	Proration bool              `json:"proration"`
	Desc      string            `json:"description"`
	Invoice   string            `json:"invoice"`
	Meta      map[string]string `json:"metadata"`
	Sub       string            `json:"subscription"`
}

InvoiceItem is the resource represneting a Stripe invoice item. For more details see https://stripe.com/docs/api#invoiceitems.

type InvoiceItemClient

type InvoiceItemClient struct {
	// contains filtered or unexported fields
}

InvoiceItemClient is the client used to invoke /invoiceitems APIs.

func (*InvoiceItemClient) Create

func (c *InvoiceItemClient) Create(params *InvoiceItemParams) (*InvoiceItem, error)

Create POSTs new invoice items. For more details see https://stripe.com/docs/api#create_invoiceitem.

func (*InvoiceItemClient) Delete

func (c *InvoiceItemClient) Delete(id string) error

Delete removes an invoice item. For more details see https://stripe.com/docs/api#delete_invoiceitem.

func (*InvoiceItemClient) Get

func (c *InvoiceItemClient) Get(id string) (*InvoiceItem, error)

Get returns the details of an invoice item. For more details see https://stripe.com/docs/api#retrieve_invoiceitem.

func (*InvoiceItemClient) List

List returns a list of invoice items. For more details see https://stripe.com/docs/api#list_invoiceitems.

func (*InvoiceItemClient) Update

func (c *InvoiceItemClient) Update(id string, params *InvoiceItemParams) (*InvoiceItem, error)

Update updates an invoice item's properties. For more details see https://stripe.com/docs/api#update_invoiceitem.

type InvoiceItemList

type InvoiceItemList struct {
	Count  uint16         `json:"total_count"`
	More   bool           `json:"has_more"`
	Url    string         `json:"url"`
	Values []*InvoiceItem `json:"data"`
}

InvoiceItemList represents a list object for invoice items.

type InvoiceItemListParams

type InvoiceItemListParams struct {
	Created              int64
	Filters              Filters
	Customer, Start, End string
	Limit                uint64
}

InvoiceItemListparams is the set of parameters that can be used when listing invoice items. For more details see https://stripe.com/docs/api#list_invoiceitems.

type InvoiceItemParams

type InvoiceItemParams struct {
	Customer           string
	Amount             int64
	Currency           Currency
	Invoice, Desc, Sub string
	Meta               map[string]string
}

InvoiceItemParams is the set of parameters that can be used when creating or updating an invoice item. For more details see https://stripe.com/docs/api#create_invoiceitem and https://stripe.com/docs/api#update_invoiceitem.

type InvoiceLine

type InvoiceLine struct {
	Id        string            `json:"id"`
	Live      bool              `json:"live_mode"`
	Amount    int64             `json:"amount"`
	Currency  Currency          `json:"currency"`
	Period    *Period           `json:"period"`
	Proration bool              `json:"proration"`
	Type      InvoiceLineType   `json:"type"`
	Desc      string            `json:"description"`
	Meta      map[string]string `json:"metadata"`
	Plan      *Plan             `json:"plan"`
	Quantity  int64             `json:"quantity"`
}

InvoiceLine is the resource representing a Stripe invoice line item. For more details see https://stripe.com/docs/api#invoice_line_item_object.

type InvoiceLineList

type InvoiceLineList struct {
	Count  uint16         `json:"total_count"`
	More   bool           `json:"has_more"`
	Url    string         `json:"url"`
	Values []*InvoiceLine `json:"data"`
}

InvoiceLineList is a list object for invoice line items.

type InvoiceLineListParams

type InvoiceLineListParams struct {
	Id                        string
	Filters                   Filters
	Customer, Sub, Start, End string
	Limit                     uint64
}

InvoiceLineListParams is the set of parameters that can be used when listing invoice line items. For more details see https://stripe.com/docs/api#invoice_lines.

type InvoiceLineType

type InvoiceLineType string

InvoiceLineType is the list of allowed values for the invoice line's type. Allowed values are "invoiceitem", "subscription".

const (
	TypeInvoiceItem  InvoiceLineType = "invoiceitem"
	TypeSubscription InvoiceLineType = "subscription"
)

type InvoiceList

type InvoiceList struct {
	Count  uint16     `json:"total_count"`
	More   bool       `json:"has_more"`
	Url    string     `json:"url"`
	Values []*Invoice `json:"data"`
}

InvoiceList is a list object for invoices.

type InvoiceListParams

type InvoiceListParams struct {
	Date                 int64
	Filters              Filters
	Customer, Start, End string
	Limit                uint64
}

InvoiceListParams is the set of parameters that can be used when listing invoices. For more details see https://stripe.com/docs/api#list_customer_invoices.

type InvoiceParams

type InvoiceParams struct {
	Customer                          string
	Desc, Statement, Sub, AccessToken string
	Fee                               uint64
	Meta                              map[string]string
	Closed, Forgive                   bool
}

InvoiceParams is the set of parameters that can be used when creating or updating an invoice. For more details see https://stripe.com/docs/api#create_invoice, https://stripe.com/docs/api#update_invoice.

type Period

type Period struct {
	Start int64 `json:"start"`
	End   int64 `json:"end"`
}

Period is a structure representing a start and end dates.

type Plan

type Plan struct {
	Id            string            `json:"id"`
	Live          bool              `json:"livemode"`
	Amount        uint64            `json:"amount"`
	Created       int64             `json:"created"`
	Currency      Currency          `json:"currency"`
	Interval      PlanInternval     `json:"interval"`
	IntervalCount uint64            `json:"interval_count"`
	Name          string            `json:"name"`
	Meta          map[string]string `json:"metadata"`
	TrialPeriod   uint64            `json:"trial_period_days"`
	Statement     string            `json:"statement_description"`
}

Plan is the resource representing a Stripe plan. For more details see https://stripe.com/docs/api#plans.

type PlanClient

type PlanClient struct {
	// contains filtered or unexported fields
}

PlanClient is the client used to invoke /plans APIs.

func (*PlanClient) Create

func (c *PlanClient) Create(params *PlanParams) (*Plan, error)

Create POSTs a new plan. For more details see https://stripe.com/docs/api#create_plan.

func (*PlanClient) Delete

func (c *PlanClient) Delete(id string) error

Delete removes a plan. For more details see https://stripe.com/docs/api#delete_plan.

func (*PlanClient) Get

func (c *PlanClient) Get(id string) (*Plan, error)

Get returns the details of a plan. For more details see https://stripe.com/docs/api#retrieve_plan.

func (*PlanClient) List

func (c *PlanClient) List(params *PlanListParams) (*PlanList, error)

List returns a list of plans. For more details see https://stripe.com/docs/api#list_plans.

func (*PlanClient) Update

func (c *PlanClient) Update(id string, params *PlanParams) (*Plan, error)

Update updates a plan's properties. For more details see https://stripe.com/docs/api#update_plan.

type PlanInternval

type PlanInternval string

PlanInterval is the list of allowed values for a plan's interval. Allowed values are "day", "week", "month", "year".

const (
	Day   PlanInternval = "day"
	Week  PlanInternval = "week"
	Month PlanInternval = "month"
	Year  PlanInternval = "year"
)

type PlanList

type PlanList struct {
	Count  uint16  `json:"total_count"`
	More   bool    `json:"has_more"`
	Url    string  `json:"url"`
	Values []*Plan `json:"data"`
}

PlanList is a list object for plans.

type PlanListParams

type PlanListParams struct {
	Filters    Filters
	Start, End string
	Limit      uint64
}

PlanListParams is the set of parameters that can be used when listing plans. For more details see https://stripe.com/docs/api#list_plans.

type PlanParams

type PlanParams struct {
	Id, Name                   string
	Currency                   Currency
	Amount                     uint64
	Interval                   PlanInternval
	IntervalCount, TrialPeriod uint64
	Meta                       map[string]string
	Statement                  string
}

PlanParams is the set of parameters that can be used when creating or updating a plan. For more details see https://stripe.com/docs/api#create_plan and https://stripe.com/docs/api#update_plan.

type Recipient

type Recipient struct {
	Id          string            `json:"id"`
	Live        bool              `json:"livemode"`
	Created     int64             `json:"created"`
	Type        RecipientType     `json:"type"`
	Bank        *BankAccount      `json:"active_account"`
	Desc        string            `json:"description"`
	Email       string            `json:"email"`
	Meta        map[string]string `json:"metadata"`
	Name        string            `json:"name"`
	Cards       *CardList         `json:"cards"`
	DefaultCard string            `json:"default_card"`
}

Recipient is the resource representing a Stripe recipient. For more details see https://stripe.com/docs/api#recipients.

type RecipientClient

type RecipientClient struct {
	// contains filtered or unexported fields
}

RecipientClient is the client used to invoke /recipients APIs.

func (*RecipientClient) Create

func (c *RecipientClient) Create(params *RecipientParams) (*Recipient, error)

Create POSTs a new recipient. For more details see https://stripe.com/docs/api#create_recipient.

func (*RecipientClient) Delete

func (c *RecipientClient) Delete(id string) error

Delete removes a recipient. For more details see https://stripe.com/docs/api#delete_recipient.

func (*RecipientClient) Get

func (c *RecipientClient) Get(id string) (*Recipient, error)

Get returns the details of a recipient. For more details see https://stripe.com/docs/api#retrieve_recipient.

func (*RecipientClient) List

List returns a list of recipients. For more details see https://stripe.com/docs/api#list_recipients.

func (*RecipientClient) Update

func (c *RecipientClient) Update(id string, params *RecipientParams) (*Recipient, error)

Update updates a recipient's properties. For more details see https://stripe.com/docs/api#update_recipient.

type RecipientList

type RecipientList struct {
	Count  uint16       `json:"total_count"`
	More   bool         `json:"has_more"`
	Url    string       `json:"url"`
	Values []*Recipient `json:"data"`
}

RecipientList is a list object for recipients.

type RecipientListParams

type RecipientListParams struct {
	Filters    Filters
	Start, End string
	Limit      uint64
	Verified   bool
}

RecipientListParams is the set of parameters that can be used when listing recipients. For more details see https://stripe.com/docs/api#list_recipients.

type RecipientParams

type RecipientParams struct {
	Name                      string
	Type                      RecipientType
	TaxId, Token, Email, Desc string
	Bank                      *BankAccountParams
	Card                      *CardParams
	Meta                      map[string]string
	DefaultCard               string
}

RecipientParams is the set of parameters that can be used when creating or updating recipients. For more details see https://stripe.com/docs/api#create_recipient and https://stripe.com/docs/api#update_recipient.

type RecipientType

type RecipientType string

RecipientType is the list of allowed values for the recipient's type. Allowed values are "individual", "corporation".

const (
	Individual RecipientType = "individual"
	Corp       RecipientType = "corporation"
)

type Refund

type Refund struct {
	Id       string            `json:"id"`
	Amount   uint64            `json:"amount"`
	Created  int64             `json:"created"`
	Currency Currency          `json:"currency"`
	Tx       string            `json:"balance_transaction"`
	Charge   string            `json:"charge"`
	Meta     map[string]string `json:"metadata"`
}

Refund is the resource representing a Stripe refund. For more details see https://stripe.com/docs/api#refunds.

type RefundClient

type RefundClient struct {
	// contains filtered or unexported fields
}

RefundClient is the client used to invoke /refunds APIs.

func (*RefundClient) Get

func (c *RefundClient) Get(id string, params *RefundParams) (*Refund, error)

Get returns the details of a refund. For more details see https://stripe.com/docs/api#retrieve_refund.

func (*RefundClient) List

func (c *RefundClient) List(params *RefundListParams) (*RefundList, error)

List returns a list of refunds. For more details see https://stripe.com/docs/api#list_refunds.

func (*RefundClient) Update

func (c *RefundClient) Update(id string, params *RefundParams) (*Refund, error)

Update updates a refund's properties. For more details see https://stripe.com/docs/api#update_refund.

type RefundList

type RefundList struct {
	Count  uint16    `json:"total_count"`
	More   bool      `json:"has_more"`
	Url    string    `json:"url"`
	Values []*Refund `json:"data"`
}

Refundist is a list object for refunds.

type RefundListParams

type RefundListParams struct {
	Charge     string
	Filters    Filters
	Start, End string
	Limit      uint64
}

RefundListParams is the set of parameters that can be used when listing refunds. For more details see https://stripe.com/docs/api#list_refunds.

type RefundParams

type RefundParams struct {
	Charge string
	Amount uint64
	Fee    bool
	Meta   map[string]string
}

RefundParams is the set of parameters that can be used when refunding a charge. For more details see https://stripe.com/docs/api#refund.

type SubListParams

type SubListParams struct {
	Customer   string
	Filters    Filters
	Start, End string
	Limit      uint64
}

SubListParams is the set of parameters that can be used when listing active subscriptions. For more details see https://stripe.com/docs/api#list_subscriptions.

type SubParams

type SubParams struct {
	Customer, Plan             string
	Coupon, Token, AccessToken string
	TrialEnd                   int64
	Card                       *CardParams
	Quantity                   uint64
	FeePercent                 float64
	Meta                       map[string]string
	NoProrate, EndCancel       bool
}

SubParams is the set of parameters that can be used when creating or updating a subscription. For more details see https://stripe.com/docs/api#create_subscription and https://stripe.com/docs/api#update_subscription.

type Subscription

type Subscription struct {
	Id          string             `json:"id"`
	EndCancel   bool               `json:"cancel_at_period_end"`
	Customer    string             `json:"customer"`
	Plan        *Plan              `json:"plan"`
	Quantity    uint64             `json:"quantity"`
	Status      SubscriptionStatus `json:"status"`
	FeePercent  float64            `json:"application_fee_percent"`
	Canceled    int64              `json:"canceled_at"`
	PeriodEnd   int64              `json:"current_period_end"`
	PeriodStart int64              `json:"current_period_start"`
	Discount    *Discount          `json:"discount"`
	Ended       int64              `json:"ended_at"`
	Meta        map[string]string  `json:"metadata"`
	TrialEnd    int64              `json:"trial_end"`
	TrialStart  int64              `json:"trial_start"`
}

Subscription is the resource representing a Stripe subscription. For more details see https://stripe.com/docs/api#subscriptions.

type SubscriptionClient

type SubscriptionClient struct {
	// contains filtered or unexported fields
}

SubscriptionClient is the client used to invoke /subscriptions APIs.

func (*SubscriptionClient) Cancel

func (c *SubscriptionClient) Cancel(id string, params *SubParams) error

Cancel removes a subscription. For more details see https://stripe.com/docs/api#cancel_subscription.

func (*SubscriptionClient) Create

func (c *SubscriptionClient) Create(params *SubParams) (*Subscription, error)

Create POSTS a new subscription for a customer. For more details see https://stripe.com/docs/api#create_subscription.

func (*SubscriptionClient) Get

func (c *SubscriptionClient) Get(id string, params *SubParams) (*Subscription, error)

Get returns the details of a subscription. For more details see https://stripe.com/docs/api#retrieve_subscription.

func (*SubscriptionClient) List

List returns a list of subscriptions. For more details see https://stripe.com/docs/api#list_subscriptions.

func (*SubscriptionClient) Update

func (c *SubscriptionClient) Update(id string, params *SubParams) (*Subscription, error)

Update updates a subscription's properties. For more details see https://stripe.com/docs/api#update_subscription.

type SubscriptionList

type SubscriptionList struct {
	Count  uint16          `json:"total_count"`
	More   bool            `json:"has_more"`
	Url    string          `json:"url"`
	Values []*Subscription `json:"data"`
}

SubscriptionList is a list object for subscriptions.

type SubscriptionStatus

type SubscriptionStatus string

SubscriptionStatus is the list of allowed values for the subscription's status. Allowed values are "trialing", "active", "past_due", "canceled", "unpaid".

const (
	Trialing SubscriptionStatus = "trialing"
	Active   SubscriptionStatus = "active"
	PastDue  SubscriptionStatus = "past_due"
	Canceled SubscriptionStatus = "canceled"
	Unpaid   SubscriptionStatus = "unpaid"
)

type Token

type Token struct {
	Id      string       `json:"id"`
	Live    bool         `json:"livemode"`
	Created int64        `json:"created"`
	Type    TokenType    `json:"type"`
	Used    bool         `json:"used"`
	Bank    *BankAccount `json:"bank_account"`
	Card    *Card        `json:"card"`
}

Token is the resource representing a Stripe token. For more details see https://stripe.com/docs/api#tokens.

type TokenClient

type TokenClient struct {
	// contains filtered or unexported fields
}

TokenClient is the client used to invoke /tokens APIs.

func (*TokenClient) Create

func (c *TokenClient) Create(params *TokenParams) (*Token, error)

Create POSTs a new card or bank account. For more details see https://stripe.com/docs/api#create_card_token and https://stripe.com/docs/api#create_bank_account_token.

func (*TokenClient) Get

func (c *TokenClient) Get(id string) (*Token, error)

Get returns the details of a token. For more details see https://stripe.com/docs/api#retrieve_token.

type TokenParams

type TokenParams struct {
	Card                  *CardParams
	Bank                  *BankAccountParams
	Customer, AccessToken string
}

TokenParams is the set of parameters that can be used when creating a token. For more details see https://stripe.com/docs/api#create_card_token and https://stripe.com/docs/api#create_bank_account_token.

type TokenType

type TokenType string

TokenType is the list of allowed values for a token's type. Allowed values are "card", "bank_account".

const (
	CardToken TokenType = "card"
	BankToken TokenType = "bank_account"
)

type Transaction

type Transaction struct {
	Id         string            `json:"id"`
	Amount     int64             `json:"amount"`
	Currency   Currency          `json:"currency"`
	Available  int64             `json:"available_on"`
	Created    int64             `json:"created"`
	Fee        int64             `json:"fee"`
	FeeDetails []Fee             `json:"fee_details"`
	Net        int64             `json:"net"`
	Status     TransactionStatus `json:"status"`
	Type       TransactionType   `json:"type"`
	Desc       string            `json:"description"`
	Src        string            `json:"source"`
	Recipient  string            `json:"recipient"`
}

Transaction is the resource representing the balance transaction. For more details see https://stripe.com/docs/api/#balance.

type TransactionList

type TransactionList struct {
	Count  uint16         `json:"total_count"`
	More   bool           `json:"has_more"`
	Url    string         `json:"url"`
	Values []*Transaction `json:"data"`
}

TransactionList is a list object for transactions.

type TransactionStatus

type TransactionStatus string

TransactionStatus is the list of allowed values for the transaction's status. Allowed values are "available", "pending".

type TransactionType

type TransactionType string

TransactionType is the list of allowed values for the transaction's type. Allowed values are "charge", "refund", "adjustment", "application_fee", "application_fee_refund", "transfer", "transfer_cancel", "transfer_failure".

type Transfer

type Transfer struct {
	Id        string            `json:"id"`
	Live      bool              `json:"livemode"`
	Amount    int64             `json:"amount"`
	Currency  Currency          `json:"currency"`
	Created   int64             `json:"created"`
	Date      int64             `json:"date"`
	Desc      string            `json:"description"`
	FailCode  TransferFailCode  `json:"failure_code"`
	FailMsg   string            `json:"failure_message"`
	Status    TransferStatus    `json:"status"`
	Type      TransferType      `json:"type"`
	Tx        string            `json:"balance_transaction"`
	Meta      map[string]string `json:"metadata"`
	Bank      *BankAccount      `json:"bank_account"`
	Card      *Card             `json:"card"`
	Recipient string            `json:"recipient"`
	Statement string            `json:"statement_description"`
}

Transfer is the resource representing a Stripe transfer. For more details see https://stripe.com/docs/api#transfers.

type TransferClient

type TransferClient struct {
	// contains filtered or unexported fields
}

TransferClient is the client used to invoke /transfers APIs.

func (*TransferClient) Cancel

func (c *TransferClient) Cancel(id string) (*Transfer, error)

Cancel cancels a pending transfer. For more details see https://stripe.com/docs/api#cancel_transfer.

func (*TransferClient) Create

func (c *TransferClient) Create(params *TransferParams) (*Transfer, error)

Create POSTs a new transfer. For more details see https://stripe.com/docs/api#create_transfer.

func (*TransferClient) Get

func (c *TransferClient) Get(id string) (*Transfer, error)

Get returns the details of a transfer. For more details see https://stripe.com/docs/api#retrieve_transfer.

func (*TransferClient) List

func (c *TransferClient) List(params *TransferListParams) (*TransferList, error)

List returns a list of transfers. For more details see https://stripe.com/docs/api#list_transfers.

func (*TransferClient) Update

func (c *TransferClient) Update(id string, params *TransferParams) (*Transfer, error)

Update updates a transfer's properties. For more details see https://stripe.com/docs/api#update_transfer.

type TransferFailCode

type TransferFailCode string

TransferFailCode is the list of allowed values for the transfer's failure code. Allowed values are "insufficient_funds", "account_closed", "no_account", "invalid_account_number", "debit_not_authorized", "bank_ownership_changed", "account_frozen", "could_not_process", "bank_account_restricted", "invalid_currency".

type TransferList

type TransferList struct {
	Count  uint16      `json:"total_count"`
	More   bool        `json:"has_more"`
	Url    string      `json:"url"`
	Values []*Transfer `json:"data"`
}

TransferList is a list object for transfers.

type TransferListParams

type TransferListParams struct {
	Created, Date         int64
	Filters               Filters
	Recipient, Start, End string
	Status                TransferStatus
	Limit                 uint64
}

TransferListParams is the set of parameters that can be used when listing transfers. For more details see https://stripe.com/docs/api#list_transfers.

type TransferParams

type TransferParams struct {
	Amount                      int64
	Currency                    Currency
	Recipient                   string
	Desc, Statement, Bank, Card string
	Meta                        map[string]string
}

TransferParams is the set of parameters that can be used when creating or updating a transfer. For more details see https://stripe.com/docs/api#create_transfer and https://stripe.com/docs/api#update_transfer.

type TransferStatus

type TransferStatus string

TransferStatus is the list of allowed values for the transfer's status. Allowed values are "paid", "pending", "failed", "canceled".

type TransferType

type TransferType string

TransferType is the list of allowed values for the transfer's type. Allowed values are "card", "bank_account".

type TxListParams

type TxListParams struct {
	Created, Available                  int64
	Filters                             Filters
	Currency, Src, Transfer, Start, End string
	Type                                TransactionType
	Limit                               uint64
}

TxListParams is the set of parameters that can be used when listing balance transactions. For more details see https://stripe.com/docs/api/#balance_history.

type Verification

type Verification string

Verification is the list of allowed verification responses. Allowed values are "pass", "fail", "unchecked".

Jump to

Keyboard shortcuts

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