Tokens

bradrydzewski edited this page Jun 5, 2012 · 2 revisions

Create a card token

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

params := stripe.TokenParams {
    Currency: "usd",
    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/bradrydzewski/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")