~evanj/cms

ref: 99a3bb7fc511e3f448a358691896ba1300f73a93 cms/vendor/github.com/stripe/stripe-go/v71/token.go -rw-r--r-- 1.6 KiB
99a3bb7fEvan M Jones WIP(rbac): Decorator object complete. TODO: Specify role in invite. 1 year, 1 month ago
                                                                                
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
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"
	TokenTypeCard        TokenType = "card"
	TokenTypeBankAccount TokenType = "bank_account"
	TokenTypePII         TokenType = "pii"
)

// 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      `form:"*"`
	BankAccount *BankAccountParams `form:"bank_account"`
	Card        *CardParams        `form:"card"`
	Customer    *string            `form:"customer"`

	// Email is an undocumented parameter used by Stripe Checkout
	// It may be removed from the API without notice.
	Email *string `form:"email"`

	PII *PIIParams `form:"pii"`
}

// 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"`
	Type     TokenType `json:"type"`
	Used     bool      `json:"used"`
}

// PIIParams are parameters for personal identifiable information (PII).
type PIIParams struct {
	Params   `form:"*"`
	IDNumber *string `form:"id_number"`
}