Alaveteli Pro Pricing
So you've got Pro running, how about asking users to support your work by paying for access to the advanced features?
This page describes the Pro Pricing feature. It explains how to set-up and configure a payment gateway which can take regular payments from pro users to grant them access to Alaveteli Professional.
The Pro Pricing feature is enabled with the
ENABLE_PRO_PRICING configuration setting.
With the feature enabled, users will be able to submit their bank card details and subscribe to a recurring subscription plan which will give them access to all the professional features.
For a payment gateway Alaveteli Professional uses Stripe. It is widely available around the world and is easy to configure and work with.
The main advantage of Stripe is that all payment information is entered and sent directly to Stripe. They never gets transmitted to or via your Alaveteli installation so the security and data protection of those details are not a concern for you.
Creating an account
Signing up for an account with Stripe is quick and easy. Initially your account will be a limited test account.
Before you can take payments you will need to activate your account. You will need to provide legal information on you and/or your company as well as your bank details in order receive payments.
Once approved by Stripe you’ll then be able to receive payments and Stripe will transfer the money directly into your bank account.
Stripe provides a secure and robust Application Programming Interface or API which Alaveteli Professional uses to communicate with Stripe. In order to use this we require some configuration settings from your Stripe dashboard.
Follow the instructions below to set this up for your Alaveteli installation.
Stripe uses webhooks to inform the Alaveteli installation of important events, such as when a users bank card can’t be charged or when a subscription has been cancelled.
The easiest way to set up the Webhook endpoint is using a rake task this can be run from the command console:
bash$ bin/rails stripe:create_webhook_endpoint Webhook endpoint successfully created! Add this line to your general.yml config file: STRIPE_WEBHOOK_SECRET: whdec_u60BqwV5r4V4U7WmVRTuBgoR1NrPv6E4
It outputs the value for
should be set in
Setting up the subscription product
A subscription product in Stripe needs to be created. We recommend “Pro”, but this can have any name you wish but bear in mind that this name will be displayed to users.
Once a product is created you’ll then be asked to set-up its the pricing plan.
The pricing plan should be have the ID of
pro, be for a recurring quantity and
without multiple price tiers. You should set a memorable nickname for the plan
but, again, bear in mind that this will be displayed to users.
Currently we only support monthly or yearly billing interval.
It’s will be up to you to decide the price per unit and trial period.
Coupons can be created on Stripe. There are no limitations on the types of coupons created as all price calculations and adjustments are done by Stripe.
One coupon you might want to make is the pro referral coupon. This is displayed to pro users and they are encouraged to share it with other interested users.
Using a namespace
It’s possible you might have other coupons or plans already in Stripe. In this
case you’ll want to set the
If this setting is used the all Stripe pricing plan IDs and coupon codes will
need to be prefixed with the namespace like:
<namespace>-<ID or code> this
should include the hyphen the namespace.
This will prevent users from using coupons intended for other non-Alaveteli Pro subscription products.
Stripe email notifications
Stripe will automatically send out emails to customers in certain situations if configured to do so, you may want to consider:
In the email settings you can configure Stripe to email users when they are successfully charged. Alaveteli does not send these, so we recommend enabling this.
On the billing email settings the ‘Send emails when card payments fail’ setting should be disabled. These emails are sent directly from Alaveteli Professional.
Don’t add subscription from the Stripe dashboard
Currently it is not possible to use the dashboard to manually create subscriptions. If this is done your Alaveteli installation will end up out of sync with Stripe and users could be charged without being granted access to the professional features.
Testing Pro Pricing
You may wish to test Pro Pricing before enabling the
ENABLE_PRO_PRICING configuration setting. This can be done on a per user basis from the command
bash$ bin/rails console irb(main):001:0> user = User.find_by(email: 'YOUR_EMAIL_ADDRESS') irb(main):002:0> AlaveteliFeatures.backend.enable(:pro_pricing, user)
Enabling Pricing also enables a “legal” page and
counterpart sidebar that you’ll need to translate in the
same way as help pages. In
this case you must locate the templates in
The following are all the configuration settings that you can change in
config/general.yml. When you edit this file, remember it must be in the YAML syntax. It’s not complicated but —
especially if you’re editing a list — be careful to get the indentation
correct. If in doubt, look at the examples already in the file, and don’t use
All the Pro Pricing settings
Setting this will enable the Pro Pricing feature for all users.
API keys for your Stripe account. These can be found in the Stripe.com
An optional Stripe.com namespace which allows plans & coupons to be separated from other resources within Stripe. If used the Stripe resources will need IDs like: '<namespace>-<id>'.
Must be uppercase.
Webhook key for your Stripe account. These can be found in the Stripe.com
A Stripe coupon code – displayed to existing Pro users on their subscriptions page – that they can share with friends for their friends to receive a signup discount.
This should not include the
You must set a `humanized_terms` key in the Coupon Metadata to display the discount that will be applied when using the coupon (e.g. "50% off for 1 month").
code of the currency Alaveteli Professional cost should be displayed in.
Doesn't affect what currency the plans are setup in so this should match what
is configured at
The rate of Tax / VAT to add to Pro subscriptions. Note that the Price per
unit of your Stripe Product Plan must be created without tax. Alaveteli will
automatically calculate the gross amount to charge.