summaryrefslogtreecommitdiff
path: root/billing/app/controllers
diff options
context:
space:
mode:
authorjessib <jessib@riseup.net>2013-10-01 13:56:59 -0700
committerjessib <jessib@riseup.net>2013-10-01 13:56:59 -0700
commit0fe1678cd37c8e917cb28eed9eb28777d3a92283 (patch)
tree751e6eaaceef1d81a3bce020871a6b004f795f2d /billing/app/controllers
parent6b35a71db66e61c04747bf82feded014687cc528 (diff)
Allow admins to view past-due subscriptions.
Diffstat (limited to 'billing/app/controllers')
-rw-r--r--billing/app/controllers/billing_admin_controller.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/billing/app/controllers/billing_admin_controller.rb b/billing/app/controllers/billing_admin_controller.rb
new file mode 100644
index 0000000..2a5165c
--- /dev/null
+++ b/billing/app/controllers/billing_admin_controller.rb
@@ -0,0 +1,14 @@
+class BillingAdminController < BillingBaseController
+ before_filter :authorize_admin
+
+ def show
+ @past_due_atleast_90_days = Braintree::Subscription.search do |search|
+ search.days_past_due >= 90
+ end
+
+ @all_past_due = Braintree::Subscription.search do |search|
+ search.status.is Braintree::Subscription::Status::PastDue
+ end
+ end
+
+end