This Flarum extension integrates closely with Stripe to offer a clean payment integration into your forum. We leverage as much as possible to the Stripe platform, including configuring products, pricing and coupons as well as actually processing the payments.
The following modes are currently supported:
- PTA; Pay to Access. Users can pay for access to a specific permission group.
Great for offering premium memberships unlocking additional permissions or access to locked content.
- PTP; Pay to Post. Users need to pay to create discussions under specific tags.
Great for allowing for advertorials or job listing.
- PTV; Pay to View. Users need to pay to view all posts in a discussion under specified tags.
Great for locking content behind a paywall.
- PTB; Pay to Bump. Users can pay to get their discussion bumped to the top of the discussion index.
Great for ads or listings.
- Bounty; Users can donate on a discussion page to raise funds for whatever the discussion is for.
Great for feature requests or crowdfunding.
All modes are explained with screenshots in detail below.
We are open to integrate additional modes, please let us know what you have in mind!
Payment methods
Since version 0.4.0 of this extension, you can now use all Stripe payment methods for "Checkout payment mode" and "Checkout subscription mode", this includes:
- for one-off prices (checkout payment method):
- ach direct debit
- affirm
- afterpay and clearpay
- alipay
- bacs direct debit
- bancontact
- becs direct debit
- boleto
- cards
- eps
- fpx
- giropay
- grabpay
- ideal
- klarna
- konbini
- link
- oxxo
- p24
- paynow
- pre-authorized debit in Canada
- sepa direct debit
- sofort
- wechat pay
- paypal
- for recurring prices (checkout subscription mode):
- alipay (invite only)
- bacs direct debit
- becs direct debit
- boleto
- cards
- sepa direct debit
- paypal
List last updated on July 8th, 2022, check the Stripe payment methods for "Checkout payment mode" and "Checkout subscription mode" documentation for the most current information.
Premium
This extension requires an active subscription from extiverse. Once your subscription is active you can follow the instructions on the Extiverse subscriptions page to configure composer. Once completed you can run the following command for installation:
composer require blomstra/payments:"*"
For updates:
composer require blomstra/payments:"*"
php flarum migrate
php flarum cache:clear
Managed Flarum communities that we host on our hosting platform (Blomstra) have access to all premium extensions by Blomstra without additional cost.
Enable the extension inside the admin area and continue below with the Set up.
Requirements
- The PHP extension intl, verify whether you have that installed using
php -m
.
Set up
Make sure to sign up on https://stripe.com, you can start playing with this extension even in testing mode. But to actually receive money you will need a verified account.
Go to developers > API keys, now copy the Publishable key and the Secret key (you need to reveal it). Go to Webhooks, click "Add endpoint" with the following information:
- Endpoint URL:
https://yourforum.com/api/blomstra-payments/stripe/webhook
- Version: 2020-08-27 or later (the option "current" is usually fine unless you have an old account).
- Events:
customer.created
, customer.subscription.created
, payment_intent.succeeded
.
Click "Add endpoint". The page of that webhook is opened, click "reveal signing secret" and copy it.
In the flarum admin area of your community, enable the blomstra payments extension (if you haven't), open its settings tab and enter the three keys you copied: publishable key, secret key and signing secret.
Settings for testing
You can use the publishable key and secret key from your testing environment (toggle in left hand menu). You can also create webhooks for your testing environment to get a signing secret. But if your testing forum isn't accessible from the internet download Stripe cli to redirect webhook call locally; log in with the stripe cli and use stripe listen --forward-to yourdomain.com/api/blomstra-payments/stripe/webhook
.
Product configuration
For all modes you will need to set up a product inside the Stripe dashboard with at least one price. For "Pay to Access" this can be recurring, for all other modes this has to be a single "one time" price. The extension handles displaying those prices automatically as well as revoke access when subscriptions end. Once you create a product look up its ID
which starts with prod_
; you will need to enter that in the areas explained below.
PTA - Pay to Access
- How: assign a Stripe product ID of a product with one-time and/or recurring prices attached to the group edit modal inside your admin area.
- Effect: gain membership of the given group by paying one of the configured prices (so one-time or even recurring). Access levels are listed on the
yourdomain.com/access-portal
page.
- Great for: premium memberships.
Permission groups are the driving factor in authorization within Flarum, much of the other extensions are tightly connected with them. Offering paid access (and with recurring prices automatic revocation) to groups opens up any combination of permissions to these group members based on the extensions you have enabled!
The forum will gain a new page called Access Portal which will list all groups and their icons. Some information is enriched with data from the Stripe product.
Each group shows a store button with options for paying for access. A modal will pop up listing all prices; so you can configure different ones (monthly, yearly, single or even bi-annual):
PTP - Pay to Post
- How: assign a Stripe product ID of a product with a single one-time price to the tag edit modal under "(PTP) Required product" inside your admin area.
- Effect: users posting discussions inside one or more of the tags connected to a Stripe product will need to pay the total of all cost of the tags applied.
- Great for: advertorials or job boards.
The user applies tags to their discussion based on your tag settings. These can include any amount and combination of tags. Tags that have configured a Stripe product will cause discussions with these tags to be marked invisible until the author of the discussion pays the cost involved.
The cost of the discussion is based on the total amount of all applied tags with their one-time price attached. Products attached to the tag can have multiple one-time prices attached, but only one is used. This offers huge flexibility, for instance you can create a primary tag "Jobs" connected to a Stripe product with the price $ 5, but "Jobs" can also have a sub-tag called "Promoted" with a Stripe product and a price of $ 10; the total sum of the payment for a user applying both tags would be $15.
PTV - Pay to View
- How: assign a Stripe product ID of a product with a single one-time price to the tag edit modal under "(PTV) Required product" inside your admin area. Specify the threshold at which posts will be hidden can be configured under "Hide posts at this threshold".
- Effect: users opening a discussion under a tag configured for Pay to View will have posts beyond the threshold hidden from view. Once the user pays the total cost of these Pay to View tags, the content will be fully visible.
- Great for: content publishers.
PTB - Pay to Bump
- How: assign a Stripe product ID of a product with a single one-time price to the tag edit modal under "(PTB) Required product" inside your admin area. Specify whether users can bump discussions of others under
"Allow bumping discussions of others".
- Effect: users can bump discussions in tags that allow paying to bump.
- Great for: advertorials or job boards.
Bounty
- How: assign a Stripe product ID of a product with a single "Custom chooses price" type of price to the tag edit modal under "(Bounty) Require product" inside your admin area. Under permissions set whom can enable bounties on discussions under these tags, if Everyone, all discussions under that tag will have bounties, otherwise each discussions first needs approval before pledges can be made.
- Effect: users can pledge to discussions under the tags that allow bounties. If the tag requires a permission group to first enable bounties, discussions need to be manually activated.
- Great for: crowdfunding and feature request funding.
All premium extensions by Blomstra are also available for free with any of our managed Flarum communities.
FAQ
Do you take any share of my income from this extension?
No we don't. Once you subscribed to the extension via Extiverse or are using our managed Flarum hosting service, you are free to install the extension. All turnover generated with this extension are 100% yours.
Will you add more payment providers next to Stripe?
Yes we will consider alternatives or offer ways to integrate with this extension once we stabilized it enough.
Payments aren't marked as paid?
Go into your stripe dashboard and check whether your configured webhook is working properly.
Where can I get this thing of beauty?
Head over to extiverse.com/extension/blomstra/payments, create an account, verify your mail address and choose a plan.
I have another question.
Reach out to us via https://helpdesk.blomstra.net. We will get back to you as soon as we can. If you have a running subscription please mention when you started your plan and/or which plan you are on. Always add sufficient information when reporting errors. We prefer errors being reported here, but understand that sometimes you can't.