Stripe Donations Plugin


(Rimian Perkins) #1

Note: a working fork of this plugin can be found here: https://github.com/chrisbeach/discourse-donations.git

We’ve built a plugin for accepting donations via a Stripe account!

Installation instructions are in the README.

You’ll need to create a Stripe account and add your API keys to the plugin settings.

This ads a button to the main navigation page which takes the user to a Stripe payment form.


Can we make a Donation Rank List?
(Ed Arcos) #2

Any plans on automatically add a user that donated to a group? This would be good for adding a badge right to its image profile or upping them to a certain level.


(Daniela) #3

PR submitted (italian translation).


#4

Sounds great! Is there a forum with this plugin enabled so I could see it in action?

Also, any plans to allow markup in posts to render a Stripe checkout button? That would be really useful for my forum.


(Rimian Perkins) #5

Yes, that’s something I plan to work on soon.


(Rimian Perkins) #6

I only have it running on our staging server at the moment. I’ll let you know when we ship it. I’d love to hear of anyone else using it!


(Rimian Perkins) #7

I’ve released a new feature:

The user can be added to a group or awarded a badge if the transaction is successful. You’ll need to create the badge and group then configure that in the settings.


#8

Hi Rimian, how’s the Stripe plugin coming along?

When it’s ready for live use, I’d like to use it to take payments for posts from local businesses. It would replace the cumbersome way we currently take payments for commercial posts.

Your work could make my forum more profitable, and I really appreciate your efforts :thumbsup:


(Robert) #9

I am interested as well!


#10

Hi @rimian,

I tried installing the plugin but my forum wouldn’t start with the plugin installed unfortunately. The unicorn logs contain a “method not found” error.

I have raised a Github issue with the full log output

If you are no longer maintaining the discourse-donations plugin (that is, if I don’t hear back on this issue), I will attempt to fix the plugin on my fork of it: GitHub - chrisbeach/discourse-donations: A discourse plugin for accepting donations via Stripe

My original reason for forking the discourse-donations plugin is to add markdown support for creating Stripe Checkout buttons:

With my changes, Stripe checkout forms can be added to forum posts using markup:

[stripe amount=999 image=/img/someImage.png]
    Widget
[/stripe]

Which renders as:

<form action="/charges" method="POST">
    <script 
        src="https://checkout.stripe.com/checkout.js" 
        class="stripe-button"
        data-key="pk_test_6pRXXX"
        data-amount="999"
        data-name="Your Shop"
        data-description="Widget"
        data-image="/img/someImage.png"
        data-locale="auto">
    </script>
</form>

(Rimian Perkins) #11

Hi Chris,

Unfortunately I am no longer working on this project.

It sounds like a rails 5 issue. Keeping up with discourse upgrades was always an issue.

I recommend forking, yes. I might be able to merge that back in.

Kind regards,

Rimian


#12

@rimian, thanks for responding. I have fixed the Rails issue in my fork:

Note that in this commit I also changed the README.md so that the TravisCI link points to my repo - if you take my changes, you will want to avoid the README.md change.

I’m now trying to get my Stripe Checkout button working… I’m nearly there!


#13

Is discourse-donations no longer maintained by choiceaustralia?

If so, and the plugin is owner-less, I can give it some TLC from my fork, and would be open to PRs from other contributors.


(Angus McLeod) #14

@anon2041049 Nice work! I had a quick look at this because I’m thinking about adding a donate button to my sandbox.

If you’re still working on this, maybe we can work in this together?

Here’s a couple of small changes.

One bigger change to be made is that we need to store the stripe customer id in a UserCustomField so it can be used when charging repeat donors. Currently, every new transaction from the same user is creating new duplicate stripe customers.

The time to store it would be after the creation of a new customer in the stripe service (which should also be a separate method, so it doesn’t need to be repeated in each different type of charge).

*edit. Also, it doesn’t look like the plugin is dealing with the Stripe transaction fee explicitly atm? I once did a Stripe WP integration for a charity. We found it best to explicitly tell the donor what the transaction fee was and ask them whether they wanted to cover it (most people do). The formula to calculate the transaction fee (by itself) is:

Fee($) = ((Donation  + .3 )  /  (1 - {Regional Percentage})) - Donation

If you’re wondering why it’s not just Donation x Regional Percentage (e.g. 2.9%) + Fixed fee (i.e. 30c), it’s because the amount you charge the donor as the transaction fee is applied to whatever total is charged from the donor’s card.

For example, if the donation is $100 the basic Stripe formula would tell us that the transaction fee is $3.2 (in the US):

3.2 = 100 x 0.029 + 0.30

If you then charge the donor $103.2, Stripe will actually apply the transaction fee to $103.2, not $100. This results in an actual transaction fee of $3.2928, leaving the donee with $99.9072 rather than $100. This difference is inconsequential with smaller sums, but not insubstantial with larger donations.


#15

Delighted to benefit from your plugin writing experience @angus :+1:

I have made you a collaborator in GitHub so you should be able to commit directly to the repo in future.

The proposals regarding storing the Stripe Customer id, and making transaction fees visible to the donor so they can choose to cover them - both sound good to me.

Separately, I’m working on an another Discourse plugin that uses Stripe. This plugin will store transactions from forum users in the database, and allow the balance to be spent on pinning topics.

It’s slow going as I’ve decided to properly learn Rails and Ruby first, and coming from the comfortable statically-typed Java/Scala world, it’s quite a change!


(Angus McLeod) #16

Awesome thanks. I’ll add some more improvements via PRs if I have the time. PRs are still the way to go I reckon just to make sure you’re in the loop.

You mean people will pay money into a balance? Maybe a balance they see in their profile?

Neat. What kind of topics are they? Are folks advertising stuff?

Let me know if you get stuck with the Discourse codebase.


#17

Yup, on my local community forum, residents can post all they like, but I charge businesses if they want to create topics:

The process is embarrassingly manual at the moment. I’m hoping Stripe integration will encourage businesses to promote on my forums.


#18

Absolutely, yes. There will be a page of transactions (money in via stripe and money out via pinning promotional topics). Important to track all actions in an “accounting” style so the balance can be reconciled.

The balance can be shown on the header for the benefit of the user and admins.

There may well be other forum features that businesses are willing to pay for too.


(Angus McLeod) #19

Funnily enough I spent 6 years of my childhood very close to Forest Hill. We lived on Madeira Road in Streatham. I was about to start at Dulwich College, then we moved back to Aus…maybe a story for a separate topic :slight_smile:

Yeah, this is pretty key. Perhaps there’s a way to outsource the tracking of individual accounts to Stripe and just have get/push endpoints in the app itself.


(Geoff Bowers) #20

We’re a community run by a not-for-profit that accepts donations. Would love to hook up Stripe such that donations are reflected on a user’s profile, and showcased separately in a “contributors page”.

For example something like this sponsors page:

We don’t really have any need for the user to have access to restricted features or services – just a way of automatically recognising the financial contributions of members of our community.

I envisage that the customer email in Stripe would marry up with the email of the user in Discourse.

I imagine it would be useful to have some additional fields in the Discourse user profile such as:

  • an optional Stripe customer email; to capture the scenario where the user’s Stripe email is different to their forum email
  • an optional Contributor Title; so that the contribution can be listed under an alternate label to the user’s name; for example, some contributors prefer to have their company listed as the contributor
  • an optional flag to keep the contribution anonymous

Would this plugin ever come close to this goal? ie. should we be collaborating here or developing something separate