Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Plans

bradrydzewski edited this page · 4 revisions

Create a plan

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

params := stripe.PlanParams{
    Id:       "gold",
    Name:     "Amazing Gold Plan",
    Amount:   2000,
    Currency: USD,
    Interval: stripe.IntervalMonth,
}

plan, err := stripe.Plans.Create(&param)

Full list of parameters for creating a Plan:
http://go.pkgdoc.org/github.com/bradrydzewski/go.stripe#PlanParams

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

Retrieve a plan

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

plan, err := stripe.Plans.Retrieve("gold")

Update a plan

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

plan, err := stripe.Plans.Update("gold", "Super Insane Gold Plan") 

Delete a plan

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

plans, err := stripe.Plans.Delete("gold") 

List all plans

stripe.SetKey("vtUQeOtUnYr7PGCLQ96Ul4zqpDUO4sOE")

plans, err := stripe.Plans.List() 

List a range of Plans:

// get a list of 10 plans, starting at position 40 in the list
plans, err := stripe.Plans.ListN(10, 40) 
Something went wrong with that request. Please try again.