Skip to content

Commit

Permalink
Document commands for setting up Stripe
Browse files Browse the repository at this point in the history
  • Loading branch information
emanuelen5 committed Jan 10, 2024
1 parent ac785e8 commit 8e13767
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ These subscriptions will automatically be turned into makeradmin products so tha

Note: You should _not_ modify these products in makeradmin. They will be reset whenever the docker container restarts anyway (when the registration page is visited).

#### Needed Stripe configuration

The configuration needed on stripe is:

- Create a **product** for base membership. Add the metadata "subscription_type"="membership" to the **product** item
Expand All @@ -193,6 +195,24 @@ The configuration needed on stripe is:
- Add a **price** for N months, where N is the binding period as specified in `stripe_subscriptions.py->BINDING_PERIOD`. The price should be N times the recurring price. Add the metadata "price_type"="binding_period"
- Create a **coupon** for low income discount. It should be with percentage discount. Add the metadata "makerspace_price_level" = "low_income_discount"

You can achieve all of this using the Stripe CLI:

```bash
# Create a yearly membership product with a price
stripe products create -d 'metadata[subscription_type]=membership' --name='Base membership'
# -> This gives a product ID `prod_MEMBERSHIP` that you need to substitute below
stripe prices create --unit-amount=20000 --currency=sek -d "recurring[interval]"=year --product="prod_MEMBERSHIP" -d "recurring[interval_count]"=1 -d 'metadata[price_type]=recurring'

# Create a makerspace access product with prices
stripe products create -d 'metadata[subscription_type]=labaccess' --name='Makerspace access'
# -> This gives a product ID `prod_LABACCESS` that you need to substitute below
stripe prices create --unit-amount=30000 --currency=sek -d "recurring[interval]"=month --product="prod_LABACCESS" -d "recurring[interval_count]"=1 -d 'metadata[price_type]=recurring'
stripe prices create --unit-amount=60000 --currency=sek -d "recurring[interval]"=month --product="prod_LABACCESS" -d "recurring[interval_count]"=2 -d 'metadata[price_type]=binding_period'

# Create a coupon
stripe coupons create --name='Low income discount' --percent-off=50 -d 'metadata[makerspace_price_level]=low_income_discount'
```

If you try to access any page which needs these products (e.g. the registration page, or the member page), makeradmin will fetch them from stripe and do a bunch of validation checks.

### Setting up required products in makeradmin
Expand Down

0 comments on commit 8e13767

Please sign in to comment.