KISO Docs

Admin Areas

#Overview

KISO Stripe Payments ships with a comprehensive set of Admin screens that you can use in your app for handling Stripe transactions or Subscriptions.

#Aliasing KISO Stripe Payment Admin Routes

If you want the routes for KISO Stripe Payments Admin screens to be shorter, or under your existing Admin section routes, you can use a namespace to perform an alias for you:
namespace :admin do
  get "/transactions" => "/kiso_stripe_payments/admin/transactions#index"
  get "/subscriptions" => "/kiso_stripe_payments/admin/subscriptions#index"
end

#Authenticating into the Admin sections

KISO Stripe Payments will leverage whatever current authentication scheme you are using. All you have to do is additionally set the session cookie kiso_stripe_payments_admin when handling an Admin login in your app.
An example change to and AdminController in your app might look like:
class Admin::AdminControllerBase < ApplicationController
  AUTHENTICATION_REALM = "localhost"

  # Encode with Digest::MD5.hexdigest(["username",AUTHENTICATION_REALM,"password"].join(":"))
  AUTHENTICATION_ENCODED_DIGEST = "c88e26a2339d6b556e7edc89d189734d"

  before_action :authenticate_admin

  def authenticate_admin
    return if admin?

    if authenticate_with_http_digest(AUTHENTICATION_REALM) { |username|  username.casecmp('admin').zero? ? AUTHENTICATION_ENCODED_DIGEST : false }
      session[:admin] = true
      session[:kiso_stripe_payments_admin] = true
    else
      request_http_digest_authentication(AUTHENTICATION_REALM, "Authentication failed")
    end
  end

  def admin?
    session[:admin].present?
  end
end

#Subscriptions Admin

We've included a fully working view which serves as a dashboard for all of your Subscriptions data:
In this view you can see:
  • A breakdown of your plan levels
  • Basic Monthly Recurring Revenue
  • Basic Active Subscriptions Count
  • A List of subscriber details

#Subscription Plan Admin

You'll find a complete working admin section at kiso_stripe_payments/admin/plans for the creation and management of Stripe plans.

#Subscription Product Admin

At kiso_stripe_payments/admin/products you'll find a complete working Admin section for the creation and managing of Stripe Products. When you create a Stripe Product in KISO Stripe Payments, clicking the 'Sync' button will create the Stripe Product and it's associated Stripe Plans with Stripe itself.

#Transactions Admin

In this fully working view, you can see all Transactions data that you might have:
From this Admin View you can:
  • Filter transactions by status: All, Completed, Processing, Failed, or Refunded
  • Export all transaction data as a CSV
  • View the details of a Transaction
    • Refund it
    • Delete it