Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Adds support for paid subscriptions through Spreedly.
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
app
config
db/migrate
lib/tasks
public/javascripts
spec
CHANGELOG
README
Rakefile
TODO
spreedly_extension.rb

README

= Spreedly Extension for Radiant

Adds support for paid subscriptions through Spreedly.

== Installation

From the target Radiant project:
  
  script/extension install spreedly
  
After installing the plugin run the migrations and update:
  
  rake radiant:extensions:spreedly:migrate
  rake radiant:extensions:spreedly:update
  
Start your project, login as an admin, and visit the Extensions page. The Spreedly
extension should be listed there. You should also see two new tabs near the top
of the page, "Spreedly" and "Subscribers."

Subscriber, login, and registration pages are added to your Radiant project during
installation. Click on the "Pages" tab to view these. They can be modified as
needed so long as the Radius tags and the slug are not disturbed.

== Upgrading from v1.0 to v1.1+

Version 1.0 of the Spreedly extension runs against the Spreedly API v3. Version 1.1+
of the extension runs against API v4. To upgrade from 1.0 to 1.1+, remove the old
extension completely and install the new one. Then, visit the "Spreedly" tab in the
admin and set the "Site Name" to your Spreedly site name. Save and revisit the
tab to select a plan from the "Plan" drop-down. All done!

Note: There is no longer a drop-down to toggle between your Spreedly production and
test sites. This is because v4 of the API uses site names to distinguish between
these sites. By configuring with your test site name, you will by definition be
using your test site. The same goes for your production site name.

== Configuring Spreedly

If you haven't registered with Spreedly, go ahead and sign up for an account. Once
you've logged in, choose either the testing or production environment based on whether
you want to test your subscription service or actually start charging people.

Under Configuration, choose or create the subscription plan you want to use. Change
its return URL to:

  http://domain.com/subscriber

Where domain.com is your web site URL. Also under Configuration, go into Site URLs
and set the Subscribers Changed Notification URL to:

  http://domain.com/subscriber_actions/changed

== Configuring the Spreedly Extension

Spreedly must also be configured on your local site. Login as an admin and click the
"Spreedly" tab, then click edit. Enter the your Spreedly account name and the ID of
the subscription plan you want to use. Mode can be set to "Test" when you're
testing your site with Spreedly, but you should change it to "Production" and clear
the subscribers out of your database before you actually start charging users for
real subscriptions.

== Managing Subscribers

Login as an admin and click on the Subscribers tab to view a list of subscribers
who have registered on your site. You can edit existing subscribers to change their
password or email address from this page. New subscribers can also be created
if you'd prefer to bypass registration through the site.

== Subscription Plans

The extension only supports using one subscription plan at a time. Select the
subscription plan you would like to use from the "Spreedly" tab.

== Protecting Pages

To make a page accessible to subscribers only, set its page type to "Paid Subscribers
Only." The next time a user visits the page, they will be prompted to login or register.
They won't be able to access the protected page until they have registered and paid
for a subscription through Spreedly.

Using a page type of "Subscribers Only" will only allow registered subscribers to
access the page, regardless of whether they have paid through Spreedly or not.

== Radius Tags

<r:subscriber:username />
Renders the username of the current subscriber.

<r:subscriber:logout />
Renders a logout link for the current subscriber.

<r:subscriber:subscription />
Renders the status of the current subscriber's Spreedly subscription.

<r:subscriber:refresh />
Renders a link to refresh the subscriber's account status from Spreedly. Override
the link text using the title attribute (e.g. <r:subscriber:refresh title="Refresh" />)

<r:subscriber:login:form />
Renders a login form for subscribers.

<r:subscriber:register:link />
Renders a link to register a new subscriber. Override the link text using the title
attribute (e.g. <r:subscriber:register:link title="Register" />)

<r:subscriber:register:form />
Renders a registration form for new subscribers.

<r:flash:notices />
Displays any pertinent user notices. For example, notification that the login failed
or that the requested page can only be accessed by paid subscribers.

== Future Development

See the TODO file.

== Resources

Repository: http://github.com/pelargir/radiant-spreedly-extension/
Blog: http://matthewbass.com
Author: Matthew Bass

Extraction work sponsored by Terralien
Something went wrong with that request. Please try again.