This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
Customers
Ashwin Purohit edited this page Aug 22, 2014
·
7 revisions
stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")
params := stripe.CustomerParams{
Email: "george.costanza@mail.com",
Desc: "short, bald",
Card: &stripe.CardParams {
Name : "George Costanza",
Number : "4242424242424242",
ExpYear : 2014,
ExpMonth : 12,
},
}
customer, err := stripe.Customers.Create(¶ms)
Create a new customer object with an active credit card, using a Token.
stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")
params := stripe.CustomerParams{
Email: "george.costanza@mail.com",
Desc: "short, bald",
Token: "tok_jOq0M8vJprCUUU",
}
customer, err := stripe.Customers.Create(¶ms)
List of parameters for Creating a Customer:
http://godoc.org/github.com/drone/go.stripe#CustomerParams
Official Stripe Documentation:
https://stripe.com/docs/api#create_customer
stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")
customer, err := stripe.Customers.Retrieve("cus_Lt6VFhU30fptWh")
stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")
params := stripe.CustomerParams{
Desc: "Customer for site@stripe.com" }
customer, err := stripe.Customers.Update("cus_Lt6VFhU30fptWh", ¶ms)
stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")
_, err := stripe.Customers.Delete("cus_Lt6VFhU30fptWh")
customers, err := stripe.Customers.List()
List a range of customers:
// get a list of 10 customers, starting at position 40 in the list of customers
customers, err := stripe.Customers.ListN(10, 40)