- "Advertise" page (accessible via top menu and hamburger menu) allows users to make payment using Stripe Checkout
- After making a payment, users are able to create a pinned topic
- Admins can view transactions by clicking the "Transactions" button on user admin pages
- Users with transactions are displayed with a credit card icon:
- Install plugin. Instructions here. Clone URL: https://github.com/chrisbeach/discourse-paid-pinning.git
- Create an account at Stripe.com. On the dashboard page you'll find the necessary API keys in the "API" section
- On your Discourse instance: Admin > Plugins > discourse-paid-pinning Settings
- Enter your Stripe key (public and secret)
- Tweak other settings as necessary
- Click to "Enable paid pinning plugin"
It may be necessary to perform one-off admin operations on user transactions.
Use the rails console.
To start the console, open a terminal and cd to your discourse directory (usually /var/discourse
):
./launcher enter app
rails c
Example:
Txns.remove_all_txns([user_id])
(substitute the relevant user id)
add_txn(user, amount, created_by, type, topic_id = nil, note = "")
Example:
Txns.add_txn(User.where(id: 2).first, 10000, 1, 3, nil, "a free gift")
- Stripe Checkout Reference: https://stripe.com/docs/checkout/tutorial
Chris Beach <chris @ chrisbeach . co . uk>
NOTE: This plugin is not supported or officially endorsed by Stripe (https://stripe.com)