Giter Site home page Giter Site logo

kimardenmiller / discourse-paid-pinning Goto Github PK

View Code? Open in Web Editor NEW

This project forked from chrisbeach/discourse-paid-pinning

0.0 1.0 0.0 508 KB

Allows forum members to pay for pinned topics

License: Apache License 2.0

Ruby 47.96% JavaScript 37.56% HTML 11.34% CSS 3.13%

discourse-paid-pinning's Introduction

Discourse Paid Pinning Plugin

Build Status

  • "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

Advertise Page

Admin Features

  • Admins can view transactions by clicking the "Transactions" button on user admin pages

Admin Transactions

Admin Transaction Modal

  • Users with transactions are displayed with a credit card icon:

User Icon

Installation

  1. Install plugin. Instructions here. Clone URL: https://github.com/chrisbeach/discourse-paid-pinning.git
  2. Create an account at Stripe.com. On the dashboard page you'll find the necessary API keys in the "API" section
  3. On your Discourse instance: Admin > Plugins > discourse-paid-pinning Settings
    1. Enter your Stripe key (public and secret)
    2. Tweak other settings as necessary
    3. Click to "Enable paid pinning plugin"

Using the Rails Console to Manually Add or Remove Transactions

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

Remove all transactions for a user:

Example:

Txns.remove_all_txns([user_id])

(substitute the relevant user id)

Add a transaction to user:

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")

Reference

Author

Chris Beach <chris @ chrisbeach . co . uk>

License (Apache 2.0)

NOTE: This plugin is not supported or officially endorsed by Stripe (https://stripe.com)

discourse-paid-pinning's People

Contributors

chrisbeach avatar felixgerberding avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.