Stripe Donations Plugin

@ChrisBeach 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.

https://github.com/chrisbeach/discourse-donations/pull/2

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.

6 Likes