franckverrot / terraform-provider-stripe

A Terraform Provider for Stripe
https://registry.terraform.io/providers/franckverrot/stripe/latest
Mozilla Public License 2.0
242 stars 51 forks source link

Add Stripe Prices functionality #33

Closed jchorl closed 4 years ago

jchorl commented 4 years ago

Greetings!

Stripe has a prices api. This PR adds support for their prices API with a lot of the common parameters.

This required updating the vendored stripe version, so I broke this up into a few commits. I'd recommend reviewing one at a time.

  1. Add the logic for stripe prices
  2. Updated all files to import v71 and then ran go get ./...
  3. Ran go mod vendor and go mod tidy
  4. Generated authors

Here's a sample tf payload that I applied successfully:

resource "stripe_price" "josh_test_price" {
  product        = stripe_product.josh_test_product.id
  billing_scheme = "per_unit"
  unit_amount    = 5
  currency       = "usd"
  metadata       = { mydata = "some neat data" }
  recurring = {
    aggregate_usage = "sum"
    interval        = "month"
    usage_type      = "metered"
  }
}
MihaiBlebea commented 4 years ago

This looks great.

jchorl commented 4 years ago

@franckverrot any chance I could trouble you to take a look at this?

franckverrot commented 4 years ago

Thanks for the PR, sorry I didn't get the chance to do it earlier... Here's the release https://github.com/franckverrot/terraform-provider-stripe/releases/tag/v1.6.0

jchorl commented 4 years ago

Thank you!