Dave
Dave

Reputation: 1175

How can I integrate Spreedly/Chargify with a rails app?

I'm a crappy novice programmer and am working on an app which I want Spreedly or Chargify or something similar to do recurring billing.

The documentation seems really good but its not dumbed down enough for me to make any use of it.

I'm only after the most basic integration, where I expose a subscription link take the user to the recurring billing people's page, they put in the billing info then the page redirects back to my site and the necessary bits are updated.

My app works like this:

  1. A user signs up and gets an account.
  2. The user's account can have many venues assigned to it.
  3. All the venues start with a free status, but each can be upgraded to premium status via a menu only available to the user who owns the venue.

So how can I expose the link so that it takes the venues ID, bills the user and updates the venues plan field?

The venues plan field is set in the model as:

PLANS = %w[free premium]

Venues edit.html.erb

<div id="tabs-4">
  <%= form_for @venue, :html => { :multipart => true } do |f| %>    

    <h2 class="venue_show_orange">Payments</h2>

    <div class="button">
      <p class="button_test">Upgrade</p>
    </div>
  <% end %>
</div>

Thanks for any help its very much appreciated!

Upvotes: 1

Views: 392

Answers (1)

Dmitry Polyakovsky
Dmitry Polyakovsky

Reputation: 1585

I would look at Spreedly Express https://docs.spreedly.com/guides/adding-payment-methods/express/. Very easy for novice programmers.

Upvotes: 0

Related Questions