forked from stripe/stripe-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
token.go
33 lines (30 loc) · 1.14 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
package stripe
// TokenType is the list of allowed values for a token's type.
// Allowed values are "card", "bank_account".
type TokenType 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 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"`
ClientIP string `json:"client_ip"`
// Email is an undocumented field but included for all tokens created
// with Stripe Checkout.
Email string `json:"email"`
}