Skip to content

Commit

Permalink
readme and example
Browse files Browse the repository at this point in the history
  • Loading branch information
Rajan Subedi authored and franckverrot committed Jun 20, 2022
1 parent 0ddb77d commit edcefe0
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,22 @@ resource "stripe_coupon" "mlk_day_coupon_25pc_off" {
- [x] created
- [x] livemode

- [x] [Customer Portal](https://stripe.com/docs/api/customer_portal)
- [x] business_profile
- [x] headline
- [x] privacy_policy_url
- [x] terms_of_service_url
- [x] features
- [x] customer_update
- [x] allowed_updates
- [x] invoice_history
- [x] payment_method_update
- [x] subscription_cancel
- [x] subscription_pause
- [x] subscription_update
- [x] default_return_url
- [x] metadata


### Importing existing resources

Expand Down
60 changes: 60 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -184,4 +184,64 @@ resource "stripe_price" "my_graduated_price" {
up_to_inf = true
unit_amount = 100
}
}

resource "stripe_customer_portal" "customer_portal" {

business_profile {
headline = "Headline"
terms_of_service_url = "https://terms-of-service-url.example"
privacy_policy_url = "https://privacy-policy-url.example"
}

features {

customer_update {
allowed_updates = ["email", "address", "shipping", "phone", "tax_id"]
enabled = true
}

invoice_history {
enabled = true
}

payment_method_update {
enabled = true
}

subscription_cancel {
cancellation_reason {
enabled = true
options = ["too_expensive", "missing_features", "switched_service", "unused", "customer_service", "too_complex", "low_quality", "other"]
}
enabled = true
mode = "at_period_end"
proration_behavior = "none"

}

subscription_pause {
enabled = true
}

subscription_update {
default_allowed_updates = ["price", "quantity", "promotion_code"]
enabled = true
proration_behavior = "none"

product {
id = stripe_product.my_product.id
prices = [stripe_price.my_price.id]
}

}

}

metadata = {
key = "val"
}

default_return_url = "https://return.example"

}

0 comments on commit edcefe0

Please sign in to comment.