Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
peterjliu edited this page Mar 3, 2015 · 4 revisions

Create a card token

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

params := stripe.TokenParams {
	Card: &stripe.CardParams {
		Name     : "George Costanza",
		Number   : "4242424242424242",
		ExpYear  : 2014,
		ExpMonth : 12,
	},
}

token, err := stripe.Tokens.Create(&params)

Full list of parameters to Create a Token:
http://go.pkgdoc.org/github.com/drone/go.stripe#TokenClient.Create

Official Stripe Documentation:
https://stripe.com/docs/api#create_token

Retrieve an existing card token

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

token, err := stripe.Tokens.Retrieve("tok_jOq0M8vJprCUUU")
Clone this wiki locally