Skip to content

Commit

Permalink
update docs (#269)
Browse files Browse the repository at this point in the history
  • Loading branch information
vincanger authored Sep 16, 2024
1 parent 3fa35b1 commit 71d7637
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
Binary file added opensaas-sh/blog/public/stripe/switch-plans.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 11 additions & 2 deletions opensaas-sh/blog/src/content/docs/guides/payments-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ To create a test product, go to the test products url [https://dashboard.stripe.
- Make sure you select `Software as a service (SaaS)` as the product type.
- For Subscription products, make sure you select `Recurring` as the billing type.
- For One-time payment products, make sure you select `One-time` as the billing type.
- If you want to add different price tiers for the same product, click the `Add another price` button at the buttom.
- If you intend to let your users switch between two subscription plans, e.g. upgrade from hobby to pro, you'll need to create two separate products and with their own price IDs. The ability for users to swich plans can then be configured later in the [Customer Portal](#set-up-the-customer-portal).
- If you want to add different price tiers for the same product (e.g. monthly and yearly), click the `Add another price` button at the buttom.

![price ids](/stripe/price-ids.png)

Expand All @@ -89,14 +90,22 @@ To create a test customer, go to the test customers url [https://dashboard.strip
When filling in the test customer email address, use an address you have access to and will use when logging into your SaaS app. This is important because the email address is used to identify the customer when creating a subscription and allows you to manage your test user's payments/subscriptions via the test customer portal
:::

### Get your Customer Portal Link
### Set up the Customer Portal

Go to https://dashboard.stripe.com/test/settings/billing/portal in the Stripe Dashboard and activate and copy the `Customer portal link`. Paste it in your `.env.server` file:

```ts title=".env.server"
STRIPE_CUSTOMER_PORTAL_URL=<your-test-customer-portal-link>
```

If you'd like to give users the ability to switch between different plans, e.g. upgrade from a hobby to a pro subscription, go down to the `Subscriptions` dropdown and select `customers can switch plans`.

![switch plans](/stripe/switch-plans.png)

Then select the products you'd like them to be able to switch between.

Now, after your users have paid, they can click on `Manage Subscription` in the client and will be taken to the customer portal where they can update their current plan.

### Install the Stripe CLI

To install the Stripe CLI with homebrew, run the following command in your terminal:
Expand Down

0 comments on commit 71d7637

Please sign in to comment.