forked from stripe/stripe-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
token.go
37 lines (33 loc) · 1.17 KB
/
token.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package stripe
// TokenType is the list of allowed values for a token's type.
// Allowed values are "card", "bank_account".
type TokenType string
const (
CardToken TokenType = "card"
BankToken TokenType = "bank_account"
)
// 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 TokenParams struct {
Params
Card *CardParams
Bank *BankAccountParams
Customer string
// Email is an undocumented parameter used by Stripe Checkout
// It may be removed from the API without notice.
Email string
}
// Token is the resource representing a Stripe token.
// For more details see https://stripe.com/docs/api#tokens.
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"`
// Email is an undocumented field but included for all tokens created
// with Stripe Checkout.
Email string `json:"email"`
}