-
Notifications
You must be signed in to change notification settings - Fork 448
/
token.go
76 lines (68 loc) · 2.58 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
//
//
// File generated from our OpenAPI spec
//
//
package stripe
// TokenType is the list of allowed values for a token's type.
type TokenType string
// List of values that TokenType can take.
const (
TokenTypeAccount TokenType = "account"
TokenTypeBankAccount TokenType = "bank_account"
TokenTypeCard TokenType = "card"
TokenTypeCVCUpdate TokenType = "cvc_update"
TokenTypePII TokenType = "pii"
)
// TokenCVCUpdateParams is the set of parameters that can be used when creating a CVC token.
type TokenCVCUpdateParams struct {
CVC *string `form:"cvc"`
}
// TokenAccountParams is the set of parameters that can be used when creating a Account token.
type TokenAccountParams struct {
BusinessType *string `form:"business_type"`
Company *AccountCompanyParams `form:"company"`
Individual *PersonParams `form:"individual"`
TOSShownAndAccepted *bool `form:"tos_shown_and_accepted"`
}
// 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
// - https://stripe.com/docs/api#create_bank_account_token
// - https://stripe.com/docs/api/tokens/create_account
// - https://stripe.com/docs/api/tokens/create_person
type TokenParams struct {
Params `form:"*"`
Account *TokenAccountParams `form:"account"`
BankAccount *BankAccountParams `form:"bank_account"`
Card *CardParams `form:"card"`
Customer *string `form:"customer"`
CVCUpdate *TokenCVCUpdateParams `form:"cvc_update"`
// Email is an undocumented parameter used by Stripe Checkout
// It may be removed from the API without notice.
Email *string `form:"email"`
Person *PersonParams `form:"person"`
PII *PIIParams `form:"pii"`
}
// PIIParams are parameters for personal identifiable information (PII).
type PIIParams struct {
Params `form:"*"`
IDNumber *string `form:"id_number"`
}
// Token is the resource representing a Stripe token.
// For more details see https://stripe.com/docs/api#tokens.
type Token struct {
APIResource
BankAccount *BankAccount `json:"bank_account"`
Card *Card `json:"card"`
ClientIP string `json:"client_ip"`
Created int64 `json:"created"`
// Email is an undocumented field but included for all tokens created
// with Stripe Checkout.
Email string `json:"email"`
ID string `json:"id"`
Livemode bool `json:"livemode"`
Object string `json:"object"`
Type TokenType `json:"type"`
Used bool `json:"used"`
}