discourse-subscriptions/README.md

65 lines
3.0 KiB
Markdown
Raw Normal View History

2019-09-11 05:24:25 -04:00
# Discourse Patrons
[![Build Status](https://travis-ci.org/rimian/discourse-patrons.svg?branch=master)](https://travis-ci.org/rimian/discourse-patrons)
Accept payments from visitors to your [Discourse](https://www.discourse.org/) application. Integrates with [Stripe](https://stripe.com).
2019-09-12 01:13:08 -04:00
This is a newer version of https://github.com/rimian/discourse-donations.
2019-09-11 05:24:25 -04:00
## Installation
* Be sure your site is enforcing https.
* Follow the install instructions here: https://meta.discourse.org/t/install-a-plugin/19157
* Add your Stripe public and private keys in settings and set the currency to your local value.
2019-11-18 17:37:49 -05:00
## What are Subscriptions?
2019-09-11 23:13:06 -04:00
2019-11-18 17:37:49 -05:00
There are two core components to make subscriptions work for your Discourse application. These are **Products** and **Plans**.
A Product describes what the user gets when they subscribe. It has a name and description and is associated with a Discourse user group.
A Plan is how you charge your users for the Product. Plans have rates, billing intervals and trial periods. A Product may have multiple Plans. For example: a yearly and a monthly Plan. You can't change plans much once they are created but you can archive them and create new ones.
2019-09-11 23:13:06 -04:00
2019-11-18 17:59:15 -05:00
Together, Products and Plans make up subscriptions.
## How to set up your Discourse app for subscriptions.
### Set up your payment gateway.
2019-11-18 18:10:41 -05:00
Firstly, you'll need an account with the [Stripe](https://stripe.com) payment gateway. This is how you manage your transactions.
2019-11-18 17:59:15 -05:00
2019-11-18 18:10:41 -05:00
When you get a moment, take a look at Stripe's documentation. But for now, you can set up an account in test mode and see how it all works without making any real transactions. Then, if you're happy with how everything works, you can start taking real transactions. See below for test credit card numbers.
### Set up your User Groups in Discourse
2019-11-18 18:12:40 -05:00
When a user successfully subscribes to your Discourse application, after their credit card transation has been processed, they are added to a User Group. By assigning users to a User Group, you can manage what your users have access to on your website. User groups are a core functionality of Discourse and this plugin does nothing with them except and and remove users from the group you accociated with your Plan.
2019-11-18 18:10:41 -05:00
## Enter your configuration details
2019-11-18 17:59:15 -05:00
2019-09-11 05:24:25 -04:00
## Testing
2019-09-11 23:40:18 -04:00
Test with these credit card numbers:
* 4111 1111 1111 1111
2019-09-11 05:24:25 -04:00
## Warranty
This software comes without warranties or conditions of any kind.
2019-09-12 01:13:08 -04:00
## Credits
2019-11-18 18:10:41 -05:00
Many thanks to Chris Beach and Angus McLeod who helped on the [previous version](https://github.com/chrisbeach/discourse-donations) of this plugin. Many thanks to the Discourse team who sponsored this plugin! You guys rock.
2019-09-12 03:47:08 -04:00
## Known issues
* CSS is mucked up in Safari and probably Firefox too.
* The phone number isn't sent to Stripe
## TODOs
2019-09-12 05:04:10 -04:00
* Confirm dialog CSS isn't the best.
2019-09-12 04:51:40 -04:00
* Check against other themes (works ok with light and dark)
2019-09-12 03:47:08 -04:00
* Validate the model properly. Not in the stripe component
* Show the transaction on the thank you page.
2019-09-12 04:16:47 -04:00
* Work out where to put the helper tests. Name collision!